Here is another solution using the residue theorem. If we try to integrate the function $\frac{\sinh(az)}{\sinh(\pi z)}\frac{1}{1+n^2z^2}$ directly then we obtain the result
$$\int_0^\infty \frac{\sinh(ax)}{\sinh(\pi x)}\frac{{\rm d}x}{1+n^2x^2} = \frac{\pi}{2n}\frac{\sin(a/n)}{\sin(\pi/n)} -\sum_{k=1}^\infty \frac{(-1)^{k+1}}{k^2n^2-1}\sin(ka)$$
which requires knowledge of the identity $\frac{\pi}{2n}\frac{\sin(a/n)}{\sin(\pi/n)} = \sum_{k=1}^\infty \frac{kn(-1)^{k+1}}{k^2n^2-1}\sin(ka)$ to get the desired identity.
We can get around this by instead considering the slightly modified function
$$f(z) = \frac{\sinh(a z)}{\sinh(\pi z)}\frac{1+inz}{1 + n^2z^2}$$ Under $z\to-z$ the two term in $f$ are even and odd respectively giving us
$$\int_{-\infty}^\infty f(x)\,{\rm d}x = 2\int_{0}^\infty \frac{\sinh(a x)}{\sinh(\pi x)}\frac{{\rm d}x}{1 + n^2x^2}$$
and both of the integrals above converge as long as $|a|<\pi$.
We now integrate $f$ from $z=-R$ to $z=R$ along the real axis and then along a semi-circle $C_R$ in the upper half-plane. We take $R=N+\frac{1}{2}$ for some $N\in\mathbb{N}$ to avoid integrating over one of the poles of $f$. For this choice of $R$ we have $|f(z)| \leq \frac{1}{nR-1}$ along $C_R$ so $\lim\limits_{R\to\infty}\int_{C_R}f(z)\,{\rm d}z = 0$.
The poles of $f$ in the upper half plane are located at $z=ik$ for $k\in\mathbb{N}$ with
$$\text{Res}\left[\frac{\sinh(a z)}{\sinh(\pi z)}\frac{1+inz}{1 + n^2z^2}; ik\right] = \frac{1}{\pi i}\frac{(-1)^{k+1}}{1+kn}\sin(ka)$$
and by the residue theorem it follows that
$$\int_{0}^\infty \frac{\sinh(a x)}{\sinh(\pi x)}\frac{{\rm d}x}{1 + n^2x^2} = \sum_{k=1}^\infty \frac{(-1)^{k+1}}{1+kn}\sin(ka)$$