Is the following proof correct, or are certain steps illegal?
Suppose $f:G_1\to G_2$ is a surjective group isomorphism, $N_1\lhd G_1, N_2\lhd G_2$ normal subgroups, with $N_1=f^{-1}(N_2)$. Prove that $(G_1/N_1)\cong (G_2/N_2)$.
Proof:
As $f$ is surjective, we an use the first isomorphism theorem to get $G_1/\ker(f)\cong G_2$, which implies that $$(G_1/\ker f)/(N_1/\ker f)\cong G_2/(N_1/\ker f)$$
Using the first isomorphism theorem we also know that $$N_1/\ker (f)\cong f(N_1)=f(f^{-1}(N_2))=N_2$$
Combining this we can see that $(G_1/\ker f)/(N_1/\ker f)\cong G_2/(N_1/\ker f)\cong G_2/N_2$.
Using the third isomorphism theorem we have that: $$ (G_1/\ker f)/(N_1/\ker f)\cong G_1/N_1$$
And from the last two lines we have $G_1/N_1\cong G_2/N_2$ $\tag*{$\Box$}$
It's basically correct. However, some things you wrote requires proper justification or explanation. Namely,
For a more direct approach, consider the arising homomorphism $G_1\to G_2/N_2$.