Given $2$ subgroups $N,K < G$ with $N$ normal in $G$ and $N \cap K = \{e\}$ and $G = NK$. Prove that $G/N$ is isomorphic to $K$ The problem statement is as follows

$G$ is a group. $N,K < G$. $N \lhd G$. $N \cap K = \{e\}$ and $G = NK$. Show that $G/N \cong K$.


This seems like an application of the $1^{\text{st}}$ Isomorphism Theorem to me. What I understand about the theorem is that if given a normal subgroup $N \lhd G$ then to show that $G/N$ is isomorphic to some other group it suffices to show that there is a surjective homomorphism from $G$ onto this other group where the kernel of the homomorphism is $N$. Correct?
So, in this context it seems that we would want to find a surjective homomorphism from $G$ to $K$ whose kernel is $N$? Given this, would the homomorphism be something like $\phi: G \to K$ defined by $$\phi(g) = \begin{cases} g & \text{if}\ g \in K \\ e & \text{if}\ g \in N \end{cases}$$ That way this function would simply preserve any element of $G$ that is in $K$ and send any element of $G$ that is in $N$ to the identity. Hence the kernel of the function being all of $N$.
After trying to prove that this is a homomorphism I'm seeing that it is not. Since given $g,g' \in G$ if $g \in K$ and $g' \in N$ then $\phi(gg')$ is not necessarily in $K$ but $\phi(g)\phi(g') = (g)(e) = g \in K$.

Given that, I'd like to know if this is at least the correct approach and I suppose if anyone has any hints as to what I should be considering when constructing this homomorphism (provided, again, the approach is correct) that would be greatly appreciated.
 A: I think your original attempt is not correct because it is not necessarily that $G$ is the union of $N$ and $K$, which means that not all elements of $G$ must be in $N$ or in $K$.
For each $g\in G$, since $G=NK$, there exists $n\in N$ and $k\in K$ such that $g=nk$. And because $N\cap K=\{e\}$, the choice of $n$ and $k$ are unique, for suppose that there exists $x\in N$ and $y\in K$ such that $nk=xy$, then we have $x^{-1}n=yk^{-1}\in N\cap K$ which implies that $x=n$ and $y=k$. Therefore the homomorphism $\phi:G\rightarrow K$ defined by $g\mapsto k$ is well-defined.
Next we want to check that $\phi$ is a homomorphism.
Let $g,g'\in G$. Then $g=n_1k_1$ and $g'=n_2k_2$ where $n_1,n_2\in N$ and $k_1,k_2\in K$. Since $N$ is normal, $k_1N=Nk_1$ and therefore $k_1n_1=n_3k_1$ for some $n_3\in N$.
Now
$$\begin{align}
\phi(gg')&=\phi(n_1k_1n_2k_2)\\
&=\phi(n_1n_3k_1k_2)\\
&=k_1k_2\\
&=\phi(g)\phi(g').
\end{align}$$
It is straightforward to see that $\ker\phi=\{nk:n\in N \text{ and }k=e\}=N$ and for each $k\in K$, $\phi(k)=k$. Therefore you can conclude by using the First Isomorphism Theorem.
