Let $X$ be a nice topological space and denote by $\pi\_1(X)$ its fundamental group. 


It is well-known that there is a well-defined map 
$$
0 \rightarrow H^2(\pi\_1(X),A) \rightarrow H^2(X,A),$$
where $A$ is an abelian group, seen as a trivial $\pi\_1(X)$-module. I am looking for a concrete interpretation of this map.


For instance, for $A = \mathbb{Z}$, $H^2(\pi\_1(X),A)$ classifies the central extensions by $\mathbb{Z}$ of $\pi\_1(X)$, whereas $H^2(X,A)$ classifies the complex line bundles over $X$. I cannot see an obvious construction of a complex line bundle from a $\mathbb{Z}$-extension of the fundamental group...


Thank you very much!



Interpretation of the monomorphism $H^2(\pi_1(X),\mathbb{Z}) \rightarrow H^2(X,\mathbb{Z})$
First, let's see what is this map $H^2(\pi\_1(X),A) \rightarrow H^2(X,A)$.


$\pi\_1(X)$ is characterized by the following property: A set endowed with a left action of $\pi\_1(X)$ is the same thing as a locally constant sheaves over $X$.


This mean in particular that there is a natural functor from $\pi\_1(X)$-sets to the category $Sh(X)$ of sheaves of set over $X$. This functor is the pullback functor along a geometric morphism of toposes $X \rightarrow B\pi\_1(X)$ (where $X$ denotes the topos of sheaves over $X$ and $B\pi\_1(X)$ the topos of sets with action of $\pi\_1(X)$.
The cohomology of the topos of sheaves is the ordinary cohomology of topological space and the cohomology of $B\pi\_1(X)$ is ordinary group cohomology. So this map you are talking about is from this perspective just the natural action of a continuous map on cohomology.


Now, unless you are willing to use a description of element of $H^2(\_,A)$ as sheaves of groupoid with a $BA$-action, a more explicit answer to your question is I think a bit more tricky... Indeed geometric description of cohomology class that are general enough to encompass those two kind of toposes are a bit complicated and not very easy to use in explicit situation. And the two explicit descriptions you want to use are of very different kind and uneasy to relate :


* The description of $H^2(X,\mathbb{Z})$ in terme of line bundle:
Let me denote by $\mathbb{C}^\*, \mathbb{R}$ and $\mathbb{U}$ the sheaves of continuous function with value respectively in $\mathbb{C}^\*$, $\mathbb{R}$ and $\mathbb{U}$ the group of complex numbers of module one.
This description then comes from the fact that line bundle are classified by $H^1(X,\mathbb{C}^\*)$ and that when $X$ is para-compact you have $H^1(X,\mathbb{R})$ and $H^2(X,\mathbb{R})$ that are all trivial hence the exponential long exact sequence induce an isomorphism $H^2(X,\mathbb{Z}) \simeq H^1(X,\mathbb{U})$ and as $\mathbb{C}^\* \simeq \mathbb{R} \times \mathbb{U}$ one has $H^1(X,\mathbb{U}) \simeq H^1(X,\mathbb{C}^\*)$. All these identification are false for the topos of $\pi\_1(X)$-sets so there is no way to use a similar description. Worst, the natural comparison map that always exist is in the direction $H^1(X,\mathbb{U}) \rightarrow H^2(X,\mathbb{Z})$ hence the wrong direction for associating line bundle to exact sequence... so we will at least need to use explicitly that $H^2(X,\mathbb{R})=0$.
* The description in terms of exact sequences... well there is probably dozens of way of explaining it, but anyway it boils down to very specific properties of the topos of $\pi\_1(X)$-sets and there is no analogue for $Sh(X)$... except actually something like the construction of ACL's comment but that does not goes in the correct direction to answer the question.


So I don't think there an easy way to express this relation without going through a description of cohomology class that is common to the two toposes.


A first solution would be to replace the topos $B\pi\_1(X)$ by a homotopy equivalent space for which the equivalence between line bundle and $H^2(Y,\mathbb{Z})$ holds, i.e. the Eilenberg Mac-lane space of $\pi\_1(X)$, and this is exactly what Mathias Wendt proposed in his comment. But you will have to understand how an extension gives rises to a line bundle on the Eilenberg Mac-lane space anyway.


If one just want to compute this map, one can use a "cocycle" description:


Let $ 1 \rightarrow A \rightarrow T \rightarrow \pi\_1(X) \rightarrow 1$ be a central extension.
Let $p: Y \rightarrow X$ be the universal cover of $X$ with its canonical (left) action of $\pi\_1(X)$. let $(U\_i)$ be an open covering of $X$ that trivialize the etale covering $Y \rightarrow X$ and for each $i$ let $V\_i$ be an open subset of $Y$ such that $p$ induces an homomorphism from $V\_i$ to $U\_i$.


For each $i,j$ such that $U\_i \wedge U\_j$ is non empty there is a unique element $\gamma\_{i,j} \in \pi\_1(X)$ such that $\gamma\_{i,j}$ induces an homomorphism between $V\_i \wedge p^{-1}U\_j$ and $V\_j \wedge p^{-1}(U\_i)$ above $U\_j \wedge U\_i$. So, for example, $\gamma\_{j,i} = \gamma{i,j}^{-1}$ and $\gamma\_{j,k}\gamma\_{i,j} = \gamma\_{i,k}$ at least when $U\_k \wedge U\_i \wedge U\_j$ is non-empty.


For each $i,j$ pick $\alpha\_{i,j} \in T$ a lifting of $\gamma\_{i,j}$,


And finally, for each $i,j,k$ such that $U\_i \wedge U\_j \wedge U\_k \neq \emptyset$, let $V\_{i,j,k} := \alpha\_{k,i} \alpha\_{j,k} \alpha{i,j}$. Then I claim that $V\_{i,j,k}$ is in $A$ (its image in $\pi\_1$ is trivial) and it defines a cocycle whose cohomology class does not depend on any of the choices done and is the one you are looking for (maybe up to a minus sign because I haven't been very careful).


For the special case $A = \mathbb{Z}$, whatever you do, you will need at some point to use that $H^2(X,\mathbb{R}) = 0$ in order to construct a line bundle. Maybe there is some simpler description in specific case, for example manifold, relying on specific existence results implying that $H^2(X,\mathbb{R})=0$. 


Here it appears in the fact that in order to turn our $3$-cocycle with value in $\mathbb{Z}$ into a $2$-cocyle with value in $\mathbb{U}$ which will define a hermitian line bundle we need to construct first a trivialisation of it when seen as a cocycle with value in $\mathbb{R}$. This is done by using a partition of unity $\chi\_i$ subordinate to the open cover $(U\_i)$ we started with:


For any $i,j$ such that $U\_i \wedge U\_j \neq \emptyset$ let:


$$ \lambda\_{i,j} = \exp\left( 2i\pi \sum\_k \left( \chi\_k V\_{i,j,k} \right) \right) $$


give you the $2$-cocyle with value in $\mathbb{U}$ required for the construction of the line bundle.


