This question already has an answer here:
Warning. Apparently the proof is not correct. I will update it later.
For every topological group $G$ with identity component $G^0$ it is well-known and easy to prove that $G^0$ is a normal, in fact characteristic, closed subgroup. If $G$ is locally connected, $G^0$ is open, which implies that the quotient group $G/G^0$ is discrete. The Lie algebra of $G$ is isomorphic to the Lie algebra of $G/G^0 \times G^0$, hence these Lie groups are locally isomorphic. It is not hard to see that the isomorphisms glue to a global isomorphism, since the decomposition into a product of a connected and a discrete Lie group is essentially unique.
By the way, the corresponding statement for topological groups is wrong.