Denote $\pi_i(N)/(N\cap M_i)$ by $P_i, i=1, 2.$
Define a map $f: P_1\rightarrow P_2$ by sending $\pi_1(n)+(N\cap M_1)$ to $\pi_2(n)+(N\cap M_2).$ If $k\in N\cap M_1,$ then $\pi_2(k)=0,$ so $f$ is well-defined. And $f$ is evidently surjective, so it remains to show $f$ is injective. If $\pi_2(n)\in N\cap M_2,$ then, as $n=\pi_1(n)+\pi_2(n),$ we know that $\pi_1(n)\in N$ as well, i.e. $\pi_1(n)+(N\cap M_1)=0+(N\cap M_1),$ thus $f$ is injective. Since $f$ is also a homomorphism of modules, this shows that $f$ is an isomorphism.
Hope this helps.
P.S. Thanks to @jeanmfischer, for pointing this out, that, in fact $f$ is a zero-map, i.e. the two modules in question are zero, hence isomorphic. :P