**Edit.** The OP has clarified that all of the sheaves are sheaves of locally constant functions, rather than sheaves of continuous functions or $C^\infty$ functions. In that case, it is better to consider principal bundles that are induced from an Abelian subgroup of the normalizer of the maximal torus that is not contained in the maximal torus. For instance, let $\Gamma'$ be the subgroup of $\textbf{PGL}(n,\mathbb{C})$ generated by the equivalence classes of the following two matrices,
$$
A=\left[\begin{array}{cccccc} 0 & 1 & 0 & \dots & 0 & 0\\ 0 & 0 & 1 & \dots & 0 & 0\\ 0 & 0 & 0 & \dots & 0 &0\\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots\\ 0 & 0 & 0 &\dots & 0 & 1 \\ 1 & 0 & 0 & \dots & 0 & 0
\end{array} \right], \ \
B=\left[\begin{array}{cccccc} 1 & 0 & 0 & \dots & 0 & 0\\ 0 & z & 0 & \dots & 0 & 0 \\ 0 & 0 & z^2 & \dots & 0 & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & 0 &\dots & z^{n-2} & 0 \\ 1 & 0 & 0 & \dots & 0 & z^{n-1}
\end{array} \right],
$$
where $z$ is a primitive $n^{\text{th}}$ root of unity. The group $\Gamma'$ is isomorphic to $(\mathbb{Z}/n\mathbb{Z})\times \mu_n$. The inverse image $\Gamma$ of $\Gamma'$ in $\textbf{SL}(n,\mathbb{C})$ is a non-Abelian group. It is a central extension of $\Gamma'$ by $\mu_n\cdot \text{Id}_{n\times n}$. The commutation relation is $ABA^{-1}B^{-1} = z\cdot \text{Id}_{n\times n}$. The central extension of finite groups, $$ 1 \to \mu_n\cdot \text{Id}_{n\times n} \to \Gamma \to (\mathbb{Z}/n\mathbb{Z})\times \mu_n \to 1,$$ gives a long exact sequence of non-Abelian cohomology with a connecting map, $$\delta:H^1(M;(\mathbb{Z}/n\mathbb{Z})\times \mu_n) \to H^2(M;\mu_n).$$ This connecting map is what is usually called the *Weil pairing*. There are many ways to construct the Weil pairing; the construction above is just one (probably not the best, since it is a little unclear how this behaves when you replace the integer $n$ by a multiple of $n$).

Because $\Gamma$ is a nilpotent group of nilpotency class $2$, every group homomorphism, $$\rho:\pi_1(M;\ast) \to \Gamma,$$ factors through the $2$-nilpotent quotient $\Pi(M)$ of $\pi_1(M;\ast)$. This fits into a central extension, $$0 \to \left(\bigwedge^2_{\mathbb{Z}} H_1(M;\mathbb{Z})\right)/H_2(M;\mathbb{Z})\to \Pi \to H_1(M;\mathbb{Z})\to 0,$$ where a generator $\gamma$ of $H_2(M;\mathbb{Z})$ maps to the usual relation in $\bigwedge^2H_1(M;\mathbb{Z})$, $$\gamma \mapsto \alpha_1\wedge \beta_1 + \dots + \alpha_g\wedge \beta_g$$ for the standard presentation, $$\pi_1(M,\ast) = \langle \alpha_1,\dots,\alpha_g,\beta_1,\dots,\beta_g: [\alpha_1,\beta_1]\cdots [\alpha_g,\beta_g] \rangle.$$

So now, for every integer $m$, consider the homomorphism $$\sigma_m: \Pi \to \Gamma',$$ $$\alpha_1 \mapsto [A], \ \beta_1 \mapsto [B^m], \ \alpha_{i>1} \mapsto [\text{Id}_{n\times n}], \ \beta_{j>1}\mapsto [\text{Id}_{n\times n}].$$ This maps $\gamma$ to $z^m\cdot \text{Id}_{n\times n}$. Thus, $\sigma_m$ lifts to a representation $\rho_m:\Pi \to \Gamma$ if and only if $m$ is divisible by $n$. When $m$ is not divisible by $m$, the commutator of $A$ and $B^m$ maps to $z^m\text{Id}_{n\times n}$. Thus the corresponding $\Gamma'$-principal bundle over $M$ corresponding to $\sigma_m$ has image under $\delta$ equal to $m$ times the generator of $H^2(M;\mu_n)$.

Since the long exact sequence in non-Abelian cohomology associated to a central extension is functorial, it follows that for the associated $\textbf{PGL}(n,\mathbb{C})$-principal bundle over $M$, the image under $\delta$ also equals $m$ times the generator. Thus, $\delta$ is surjective.

**Original post.**
I will add some details. Let $M$ be a compact, closed, oriented, real manifold of real dimension $2$. Denote by $\textbf{SL}(n,\mathbb{C})$, resp. $\textbf{PGL}(n,\mathbb{C})$, the real Lie group of $n\times n$ complex matrices with determinant $1$, resp. equivalence classes of $n\times n$ complex matrices up to scaling.

Denote by $T'$ the Lie subgroup of $\textbf{PGL}(n,\mathbb{C})$ consisting of equivalence classes of diagonal $n\times n$ matrices such that the first $(n-1)$ diagonal entries are all equal, say $s$, and the last diagonal entry, $t$, need not equal $s$. Denote by $T$ the inverse image of this Lie subgroup in $\textbf{SL}(n,\mathbb{C})$. This is the set of the same type of matrices, but now under the restriction that $t^{-1}$ equals $s^{n-1}$. There is a short exact sequence of Lie groups, $$1 \to \mu_n \to T \to T' \to 1,$$ where $\mu_n$ denotes the finite subgroup of scalar multiples of the identity matrix by $n^{\text{th}}$ roots of $1$. The morphism $T\to T'$ is a submersion, and even a finite unbranched cover.

For every Lie group $G$, denote by $\underline{G}$ the corresponding sheaf on $M$ of $C^\infty$ functions from open subsets of $M$ to $G$ (it would be fine to work with continuous functions). Then the short exact sequence of Lie groups above gives a short exact sequence of sheaves of Abelian groups. That short exact sequence of sheaves of Abelian groups gives a long exact sequence of cohomology. The relevant portion of that sequence is as follows, $$H^1(M,\underline{T}) \to H^1(M,\underline{T'}) \xrightarrow{\delta} H^2(M,\mu_n).$$ Both $T$ and $T'$ are isomorphic to the Lie group $\mathbb{C}^\times$ via the isomorphisms, $$T\xrightarrow{\cong} \mathbb{C}^\times, \ \ \text{Diag}(s,\dots,s,s^{-(n-1)}) \mapsto s, $$ $$T'\xrightarrow{\cong} \mathbb{C}^\times, \ \ [\text{Diag}(s,\dots,s,t)] \mapsto st^{-1}.$$ Via these isomorphisms, both $H^1(M,\underline{T})$ and $H^1(M,\underline{T'})$ are isomorphic to $H^1(M,\underline{C}^\times)$. The diagram becomes, $$H^1(M,\underline{\mathbb{C}}^\times) \xrightarrow{(-)^n} H^1(M,\underline{\mathbb{C}}^\times) \xrightarrow{\delta} H^2(M,\mu_n).$$ Using the exponential sequence of Lie groups, $$0 \to \mathbb{Z}(1) \to \mathbb{C} \xrightarrow{\text{Exp}} \mathbb{C}^\times \to 0,$$ there is a long exact sequence of cohomology. The connecting maps of that long exact sequence give a commutative diagram, $$\begin{array}{ccccc} H^1(M,\underline{\mathbb{C}}^\times) &\xrightarrow{(-)^n} & H^1(M,\underline{\mathbb{C}}^\times) & \xrightarrow{\delta} & H^2(M,\mu_n) \\ \downarrow & & \downarrow & & \downarrow \\ H^2(M,\mathbb{Z}) &\xrightarrow{n(-)} & H^2(M,\mathbb{Z}(1)) & \xrightarrow{} & H^2(M,\mathbb{Z}/n\mathbb{Z}(1)) \end{array}.$$ The last vertical map is an isomorphism; the others are the first Chern class maps. The first Chern class maps are surjective. Finally, because $H^3(M,\mathbb{Z}(1))$ is zero, it follows that for every element of $H^2(M,\mu_n)$, there exists a principal bundle for $T'$ whose associated class in $H^1(M,\underline{T'})$ maps to the specified element of $H^2(M,\mu_n)$. Since $T'$ is a Lie subgroup of $\textbf{PGL}(n,\mathbb{C})$, there is an associated principal bundle for $\textbf{PGL}(n,\mathbb{C})$. By the functoriality of non-Abelian cohomology, this principal bundle for $\textbf{PGL}(n,\mathbb{C})$ has the same image in $H^2(M,\mu_n)$.

Finally, the long exact sequence of non-Abelian cohomology is part of the basic setup of non-Abelian cohomology. In general it is not true that there is any canonical isomorphism of the fibers of the connecting map with the pointed set preceding in the sequence. What is true is that there is a "twisting" construction. There is an excellent discussion of this in Serre's "Galois cohomology". You can also find some notes on my webpage: http://www.math.stonybrook.edu/~jstarr/papers/Escola_07_08d_nocomments.pdf

1more comment