Let $\phi: G_1 \to G_2$ be an isomorphism. For notational simplicity take $Z_1 = Z(G_1), Z_2 = Z(G_2)$. Then we have that for any $\phi(z) \in \phi[Z_1]$ and for all $\phi(g) \in \phi[G_1] = G_2$ that $$\phi(z)\phi(g) = \phi(zg) = \phi(gz) = \phi(g)\phi(z)$$ i.e. $\phi(z) \in Z_2$. Thus $\phi[Z_1] \subset Z_2$. By considering the inverse $\phi^{-1}:G_2 \to G_1$ we see that $\phi^{-1}[Z_2] \subset Z_1$. But since $\phi$ is an isomorphism we have that
$$\phi^{-1}[Z_2] \subset Z_1 \implies Z_2 \subset \phi[Z_1]$$
Thus $\phi[Z_1] = Z_2$. So $\phi\downarrow_{Z_1}:Z_1 \to Z_2$ is the isomorphism you are looking for.
The intuition of the result is this: if $z_1$ commutes with everything in $G_1$, then $\phi(z_1)$ commutes with everything in $G_2$, and similarly if $z_2$ commutes with everything in $G_2$, then $\phi^{-1}(z_2)$ commutes with everything in $G_1$.