comparing homology of a space and homology of the classifying space of its fundamental group
There can not be such a condition.
For any finitely presented group $G$, we can find a closed 4-manifold $N$ with fundamental group $G$. In dimension $n \geq 6$, we can now take $M = N \times S^{n-4}$, a $n$-manifold with fundamental group $G$. Then the classifying map $f\colon M \to BG$ of the universal cover $\tilde{M} \to M$ factors through $N$, hence $$f_{\ast}\colon \ H_n(M;\mathbb Z) \to H_n(BG;\mathbb Z)$$ is zero.
Here is another source of counterexamples. Take $N$ as in Jens Reinhold's answer. Then let $M$ be the connected sum $M=N\#\mathbb C P^2$. It has the same fundamental group $G$ as $N$, and the classifying map $M\to BG$ simply collapses $\mathbb C P^2$ to a point. But $H_2(M)\cong H_2(N)\oplus H_2(\mathbb C P^2)\cong H_2(N)\oplus\mathbb Z$, and the extra $\mathbb Z$ maps to $0\in H_2(BG)$. Examples like this exist in all dimensions $\ge 4$.