Injectivity of the cohomology map induced by some projection map Given a (compact) Lie group $G$, persumably disconnected, there exists a short exact sequence
$$1\rightarrow G_c\rightarrow G\rightarrow G/G_c\rightarrow 1$$
where $G_c$ is the normal subgroup which contains all elements in the same connected component as the identity element, and $G/G_c$ can be thought of as the "finite part" of $G$.
Suppose A is a finite $G/G_c$ module (as well as a $G$ module).
The question is: Is the cohomology map
$$H^3(G/G_c, A)\rightarrow H^3(G, A)$$ induced by the projection $p:G\rightarrow G/G_c$ always injective?
The background is as follow: given any finite group T, a homomorphism $G\rightarrow T$ always factors through $G/G_c$. I wish to prove (or disprove) the similar statement for $\mathcal{T}$ a "finite" 2-group.
 A: Ok, I will follow Fernando's advice and post an answer. I learned the computation below from the beginning of Pin(2)-equivariant Seiberg--Witten Floer homology and the triangulation conjecture.
The group $\text{Pin}(2) = S^1 \cup jS^1 \subset S^3$ is a subgroup of the unit quaternions. The quotient is the topological space $S^3/\text{Pin}(2) \cong \Bbb{RP}^2$. This ultimately leads one to the fiber sequence
$\Bbb{RP}^2 \to B\text{Pin}(2) \to BS^3 = \Bbb{HP}^\infty$.
Then we have a spectral sequence $H^*(\Bbb{HP}^\infty; H^*(\Bbb{RP}^2;\Bbb F_2)) \implies H^*(B\text{Pin}(2);\Bbb F_2)$.
The $E_2$ page is given by $$\Bbb F_2[U] \otimes \Bbb F_2[V]/(V^3) = \Bbb F_2[U,V]/(V^3).$$ More precisely, when $j \le 2$ we have that $E_2^{4i,j}$ is 1-dimensional with nonzero generator $U^i V^j$ and otherwise $E_2^{i,j} = 0$.
Now the only possibly nonzero higher differentials are those of bidegree $(r,1-r)$ where (a) $r$ is divisible by $4$ and (b) $-2 \le 1-r \le 2$. These imply $r = 0$, so there are no nontrivial higher differentials.
Thus $H^*(B\text{Pin}(2); \Bbb F_2) = \Bbb F_2[U,V]/(V^3)$ and in particular $H^3$ is trivial. But $\pi_0 \text{Pin}(2) = \Bbb Z/2$ has nontrivial group cohomology in all degrees.
Remark. Here is why you might think this example is profitable. If $G \to \pi_0 G$ admits a section, your homomorphism actually is injective. However, $\text{Pin}(2) \to \Bbb Z/2$ admits no section: $(jz)^2 = -1$ regardless of what $z \in S^1$ is. The non-identity component consists entirely of elements of degree 4.
A: OK, just noticed mme's comment, which considers the very same counterexample below with a clean one-line argument. I'm leaving this here in case someone finds something of any value, but I think mme's comment should be made an answer and then accepted.

Valid counterexample but overkill proof
A counterexample related to Tyler Lawson's comment seems to work. It is a group $G$ considered by Taylor "Covering Groups of Nonconnected Topological Groups". The group $G$ is formed by the quaternions $a+bi+cj+dk\in\mathbb{H}$ satisfying:
$$a^2+b^2+c^2+d^2=1,\qquad (a^2+b^2)(c^2+d^2)=0.$$
In this case $G_c=S^1$, since it is given by the elements with $a^2+b^2=1$ and $c=d=0$, $G/G_c=\pi_0G=\mathbb{Z}/(2)$, and the extension
$$S^1\hookrightarrow G\twoheadrightarrow \mathbb{Z}/(2)$$
doesn't split, not even algebraically. Moreover, if we splice it with the short exact sequence
$$\mathbb{Z}/(2)\hookrightarrow S^1\twoheadrightarrow S^1$$
whose second map is $z\mapsto z^2$, we obtain a crossed module
$$\mathbb{Z}/(2)\hookrightarrow S^1\rightarrow G\twoheadrightarrow \mathbb{Z}/(2)$$
whose classifying element
$$\chi\in H^3(B\mathbb{Z}/(2),\mathbb{Z}/(2))\cong \mathbb{Z}/(2)$$
doesn't vanish. This was proved by Taylor and it is equivalent to the fact that $G$ doesn't have a double covering group.
Let me indicate why $\chi$ is in the kernel of
$$H^3(B\mathbb{Z}/(2),\mathbb{Z}/(2))\longrightarrow H^3(BG,\mathbb{Z}/(2)).$$
Since $G_c=S^1$ has solvable Lie algebra (in fact abelian), if $G^\delta$ denotes $G$ with the discrete topology, the morphism
$$H^3(BG,\mathbb{Z}/(2))\rightarrow H^3(BG^\delta,\mathbb{Z}/(2))$$
induced by the identity map $G^\delta\rightarrow G$ is an isomorphism by a theorem of Milnor "On the homology of Lie groups made discrete". The element $\chi$ is in the kernel of
$$H^3(B\mathbb{Z}/(2),\mathbb{Z}/(2))\longrightarrow H^3(BG^\delta,\mathbb{Z}/(2))$$
because the vertical arrow in
$$\begin{array}{cc}
&G^{\delta}\\
&\downarrow\\
\mathbb{Z}/(2)\hookrightarrow S^1\rightarrow G\twoheadrightarrow &\mathbb{Z}/(2)
\end{array}$$
has a lift (the identity $G^\delta\rightarrow G$).

Previous non-answer
You're taking cohomology of classifying spaces, aren't you? I thought first that the answer was positive, but there was a mistake in my argument. I can recycle the argument to show that there is an exact sequence
$$H^2(B\pi_0G,A)\hookrightarrow H^2(BG,A)\rightarrow H^2(BG_c,A)^{\pi_0G}\rightarrow H^3(B\pi_0G,A)\rightarrow H^3(BG,A)$$
from which one can extract various necessary and/or sufficient condition for your map (the last one in the sequence) to be injective. Here all maps, except for the third one, are induced by morphisms in the short exact sequence below.
The short exact sequence
$$G_c\hookrightarrow G\twoheadrightarrow G/G_c=\pi_0G$$
induces a fibration after taking classifying spaces
$$BG_c\hookrightarrow BG\twoheadrightarrow B\pi_0G.$$
This, in turn, gives rise to a Serre spectral sequence
$$E_2^{p,q}=H^p(B\pi_0G,H^q(BG_c,A))\Longrightarrow H^{p+q}(BG,A).$$
The spectral sequence differential $d_r$ has bidegree $(r,1-r)$ and the cohomology groups $H^q(BG_c,A)$ are regarded here as $\pi_0G$-modules.
The morphism whose injectivity you want to prove decomposes as
$$E_2^{3,0}=H^3(B\pi_0G,A)\twoheadrightarrow E_\infty^{3,0}\hookrightarrow H^3(BG,A).$$
We have exact sequences
$$E_2^{1,1}\stackrel{d_2}{\longrightarrow}E_2^{3,0}\twoheadrightarrow E_3^{3,0}$$
$$E_3^{0,2}\hookrightarrow E_2^{0,2}\stackrel{d_2}{\longrightarrow}E_2^{2,1}$$
$$E_2^{0,1}\rightarrow E_2^{2,0}\twoheadrightarrow E_3^{2,0}=E_\infty^{2,0}$$
$$E_\infty^{0,2}=E_4^{0,2}\hookrightarrow E_3^{0,2}\stackrel{d_3}{\longrightarrow}E_3^{3,0}\twoheadrightarrow E_4^{3,0}=E_\infty^{3,0}$$
The group
$$E_2^{n,1}=H^n(B\pi_0G,H^1(BG_c,A))=0$$
vanishes because $G_c$ is connected hence $BG_c$ is simply connected so $H^1(BG_c,A)=0$. Therefore
$$E_3^{3,0}=E_2^{3,0},\quad E_3^{0,2}=E_2^{0,2},\quad E_\infty^{2,0}=E_2^{2,0}.$$
Moreover, we have a short exact sequence
$$E_\infty^{2,0}\hookrightarrow H^2(BG,A)\twoheadrightarrow E_\infty^{0,2}.$$
Splicing some of the previous exact sequences we get an exact sequence
$$E_2^{2,0}\hookrightarrow H^2(BG,A)\rightarrow E_2^{0,2}\rightarrow E_2^{3,0}\rightarrow H^3(BG,A).$$
This is the first exact sequence, above. We just have to notice that
$$E_2^{0,2}=H^0(B\pi_0G,H^2(BG_c,A))=H^2(BG_c,A)^{\pi_0G}.$$
