Suppose that $\overline G$ is a Lie group such that the connected component of $1$ is $\mathbb C^*$. Assume that $\mathbb C^*$ is central in $\overline{G}$, and set $G := \overline G/\mathbb C^*$. There are two ways of constructing a class in $\mathrm H^3(G, \mathbb Z)$.
The first is to consider the central extension $$ 1 \longrightarrow \mathbb C^{*} \longrightarrow \overline G \longrightarrow G \longrightarrow 1 $$ as an extension of discrete groups; this gives a class in $\mathrm H^{2}(G, \mathbb C^{*})$, and we can take its image in $\mathrm H^{3}(G, \mathbb Z)$ via the connecting homomorphism $\mathrm H^{2}(G, \mathbb C^{*}) \to \mathrm H^{3}(G, \mathbb Z)$.
The other involves the fibration $B \overline{G} \to B G$, with fiber $B \mathbb C^{*}$. Since $B \mathbb C^{*}$ is a $K(\mathbb Z, 2)$ and the action of $G$ on $B \mathbb C^{*}$ is trivial, we obtain an obstruction to the existence of a section $BG \to B\overline{G}$, which lives in $\mathrm H^{3}(G, \mathbb Z)$. This is the second way.
An alternate construction of the second class (up to sign) is via the Leray-Serre spectral sequence $$ E^{ij}_{2} = \mathrm H^{i}(G,\mathbb Z)\otimes \mathrm H^{j}(B\mathbb C^{*}, \mathbb Z) \Longrightarrow \mathrm H^{i+j}(B \overline{G}, \mathbb Z) $$ in which the first possibly non-zero differential is $$ d_{3}\colon \mathrm H^{2}(B\mathbb C^{*}, \mathbb Z) \longrightarrow \mathrm H^{3}(G,\mathbb Z)\,. $$ Then we take the image of the canonical generator of $\mathrm H^{2}(B\mathbb C^{*}, \mathbb Z)$ under $d_{3}$.
Do these two classes coincide, up to sign? I am fairly sure that they do, and it's only my deep ignorance in algebraic topology that prevents me from seeing clearly why this is so. A reference would be better than an argument, but I'll be grateful for any hint.