I want to see that the cohomology $H^i(K(\Bbb Z_n,4); \Bbb Z)$ starts with $\Bbb Z_n$ in degree 5. How do we know that $\operatorname{hom}(H_5(K(\Bbb Z_n,4);\Bbb Z), \Bbb Z)$ is zero? I.e. why is $H_5(K(\Bbb Z_n,4))$ finite?
I am probably missing something obvious.
$K(Z_n,4)$ is the forth Eilenberg McLane space, this implies that $\pi_4(K(Z_n,4))=Z_n$ and $\pi_n(K(Z_n,4))=1$ for $n\neq 4$. Now use the Hurewicz theorem, it implies that $\pi_5(K(Z_n,4))\rightarrow H_5(K(Z_n,4),Z)$ is surjective, since $\pi_5(K(Z_n,4))=1$, you deduce the result.
https://en.wikipedia.org/wiki/Hurewicz_theorem