Suppose I have a central extension $1 \to U(1) \to \hat{G} \to G \to 1$ of a topological group $G$ by the circle group $U(1)$ in such a way that $\hat{G} \to G$ is a principal $U(1)$-bundle. Moreover, suppose that $G$ is $3$-connected. In particular, $\hat{G} \cong G \times U(1)$ as topological spaces.
Is the $3$-connectedness of $G$ enough to deduce that $\hat{G} \cong G \times U(1)$ as topological groups?
Such a central extension is described by a class in continuous group cohomology, but I can't see whether the connectedness of $G$ is any help in proving that this class is actually trivial.
In my case, $\hat{G}$ and $G$ are Banach Lie groups. So, feel free to assume that as well.