Let me see if I remember correctly. To be the Levi Civita connection, the connection forms must satisfy the following equations:
TorsionLess
$$\mbox{d}\theta^{i}={\sum}\theta^{j}\wedge\theta_{j}^{i}$$
Compatibility with the metric
$$\mbox{d}g_{ij}={\sum}\left(\theta_{i}^{k}g_{kj}+\theta_{j}^{k}g_{ki}\right).
$$
I think Cartan structure equations gives you the first condition and not the second.
I'll explain everything with a concrete example you can then generalize easily. Let us consider the Heisenberg group. We have that the Maurer Cartan form is given by
$$A^{-1}\mbox{d}A=\left(\begin{array}{ccc}
0 & 1 & 0\\
0 & 0 & 0\\
0 & 0 & 0
\end{array}\right)\mbox{d}x+\left(\begin{array}{ccc}
0 & 0 & 1\\
0 & 0 & 0\\
0 & 0 & 0
\end{array}\right)\left(\mbox{d}y-x\mbox{d}z\right)+\left(\begin{array}{ccc}
0 & 0 & 0\\
0 & 0 & 1\\
0 & 0 & 0
\end{array}\right)\mbox{d}z,$$ so we have that the invariant forms are
$$\theta^{1}=\mbox{d}x, \theta^{2}=\mbox{d}y-x\mbox{d}z, \theta^{3}=\mbox{d}z. $$
If we apply the external derivative we obtain
$$\mbox{d}\theta^{1} =0,$$
$$\mbox{d}\theta^{2} =-\mbox{d}x\wedge\mbox{d}z=-\theta^{1}\wedge\theta^{2},$$
$$\mbox{d}\theta^{3} =0.$$
The dual vectors of theinvariant differential form $\theta^{1}$, $\theta^{2}$ and $\theta^{3}$ are the vectors
$$\tilde{E}_{1} = \frac{\partial}{\partial x},$$
$$\tilde{E}_{2} = \frac{\partial}{\partial y},$$
$$\tilde{E}_{3} = x\frac{\partial}{\partial y}+\frac{\partial}{\partial z}. $$
So in the moving frame $ \left\{ \tilde{E}_{1},\,\tilde{E}_{2},\,\tilde{E}_{3}\right\} $ we have that $\left(g_{A}\right)_{ij}$ is the identity and then the equations for the compatibility with the metric (if we want to find the Levi Civita Connection) are
$$\omega_{j}^{i}+\omega_{i}^{j}=0.$$
Then from the structure equations we have
$$\mbox{d}\theta^{1}= 0 =\left(\mbox{d}y -x\mbox{d}z\right)\wedge\omega_{2}^{1}+\mbox{d}z\wedge\omega_{3}^{1},$$
$$\mbox{d}\theta^{2}= -\mbox{d}x\wedge\mbox{d}z =-\mbox{d}x\wedge\omega_{2}^{1}+\mbox{d}z\wedge\omega_{3}^{2},$$
$$\mbox{d}\theta^{3}= 0 =-\mbox{d}x\wedge\omega_{3}^{1}-\left(\mbox{d}y-x\mbox{d}z\right)\wedge\omega_{3}^{2}.$$
If we solve we then find the connection forms
$$\omega_{2}^{1} =-\omega_{1}^{2} =\frac{1}{2}\mbox{d}z=\frac{1}{2}\theta^{3},$$
$$\omega_{3}^{2} =-\omega_{2}^{3} =\frac{1}{2}\mbox{d}x=\frac{1}{2}\theta^{1},$$
$$\omega_{3}^{1} =-\omega_{1}^{3} =\frac{1}{2}\left(\mbox{d}y-x\mbox{d}z\right)=\frac{1}{2}\theta^{2}.$$
And then you have the curvature forms
$$\Omega_{2}^{1}= \theta_{3}^{1}\wedge\theta_{2}^{3} =\frac{1}{4}\theta^{1}\wedge\theta^{2},$$
$$\Omega_{3}^{2}= \theta_{1}^{2}\wedge\theta_{3}^{1} =\frac{1}{4}\theta^{2}\wedge\theta^{3},$$
$$\Omega_{3}^{1}= -\frac{1}{2}\theta^{1}\wedge\theta^{3}+\theta_{2}^{1}\wedge\theta_{3}^{2} =-\frac{3}{4}\theta^{2}\wedge\theta^{3}.$$
And at the end the Riemann coefficients
$$R_{212}^{1} = \frac{1}{4},$$
$$R_{323}^{2} = \frac{1}{4},$$
$$R_{323}^{1} = -\frac{3}{4}.$$
You need to fix a connection in your principal bundle. That is, you introduce what an horizontal vector is, and then you can project any vector field to a vertical one. In this way, you can project and then go to the Lie algebra of the group.
Best Answer
This is only true if $\dim(N)=\dim(\mathfrak g)$. The result is based on the characterization of solutions of the Maurer-Cartan equations as left logarithmic derivatives. For a Maurer-Cartan Form $\omega\in\Omega^1(N,\mathfrak g)$ and any point $x\in N$, there exists a unique smooth map from a neighborhood $U$ of $x$ in $M$ to a nighborhood of $e$ in any Lie group $G$ with Lie algebra $\mathfrak g$ such that $\omega=f^*\omega_{MC}$, where $\omega_{MC}$ is the left Maurer Cartan form on $G$. If $N$ and $G$ have the same dimension, it follows readily that $f$ has to be a local diffeomorphism, which leads to the local Lie group structure that you are looking for.
A nice exposition of this can be found in R. Sharpe's book "Differential Geometry, Cartan's generalization of Klein's Erlangen program", Springer Graduate Texts in Mathematics 166.