Equality concerning the norm of rows of a resolvent matrix.
By considering $\tilde{X}=X-\text{Re}(z)I$ in place of $X$, we may assume that $z=\mu i$ for some $\mu>0$. Now observe that
$$
(X-\mu iI)(X+\mu iI) = X^2+\mu^2 I>0.
$$ This gives
$$
G=(X-\mu iI)^{-1}=(X^2+\mu^2 I)^{-1}(X+\mu iI).
$$ Let $e_i$ be the vector whose $i$-th coordinate is $1$ and other coordinates are all $0$'s. We can observe that
$$\begin{eqnarray}
G_{ii}=e_i'Ge_i&=&e_i'(X^2+\mu^2 I)^{-1}(X+\mu iI)e_i\\&=&e_i'(X^2+\mu^2 I)^{-1}Xe_i+i\mu \cdot e_i'(X^2+\mu^2 I)^{-1}e_i
\end{eqnarray}$$ and hence
$$
\text{Im}(G_{ii})=\mu\cdot e_i'(X^2+\mu^2 I)^{-1}e_i.
$$ This gives
$$
\frac{\text{Im}(G_{ii})}{\text{Im}( z)}=\frac{\mu\cdot e_i'(X^2+\mu^2 I)^{-1}e_i}{\mu}= e_i'(X^2+\mu^2 I)^{-1}e_i.
$$
We can also see that
$$
GG^*=(X-\mu iI)^{-1}(X+\mu iI)^{-1}=(X^2+\mu^2 I)^{-1}
$$ and $\sum_{j=1}^n |G_{ij}|^2$ can be represented as
$$
\sum_{j=1}^n |G_{ij}|^2 =|G^*e_i|^2=e_i'GG^*e_i.
$$ Thus it follows
$$
\sum_{j=1}^n |G_{ij}|^2 =e_i'GG^*e_i=e_i'(X^2+\mu^2 I)^{-1}e_i=\frac{\text{Im}(G_{ii})}{\text{Im}( z)}.
$$ This proves the desired result.
Note: $e_i'$ means the transpose of $e_i$ and $G^*$ means conjugate transpose of $G$.