I am looking for an example of a closed connected smooth manifold $M$ with $\pi_1(M) = \pi_2(M) = \pi_4(M) = 0$ and $\pi_3(M) = \mathbb{Z}$, if such a thing exists.
My motivation is to represent the third integral cohomology of a 4-manifold $X$ by (homotopy classes of) maps to some manifold. Since $S^1$ is a $K(\mathbb{Z}, 1)$ and $\mathbb{CP}^\infty$ is a $K(\mathbb{Z}, 2)$, we have $H^1(X ; \mathbb{Z}) = [X, K(\mathbb{Z}, 1)] = [X, S^1]$ and, by cellular approximation, $H^2(X;\mathbb{Z}) = [X, \mathbb{CP}^\infty] = [X, \mathbb{CP}^2]$. So we can represent first and second cohomology of $X$ by maps into manifolds; my question just asks about doing so for the next higher degree.
Indeed, if we had a manifold $M$ satisfying $\pi_1(M) = \pi_2(M) = \pi_4(M) = 0$, $\pi_3(M) = \mathbb{Z}$, then we could form a $K(\mathbb{Z}, 3)$ from $M$ by attaching 6-cells and higher to kill off $\pi_5$ and higher. So, we would have that the five-skeleta of these two spaces coincide, $M^{(5)} = K(\mathbb{Z}, 3)^{(5)}$, and thus by cellular approximation $$[X, M] = [X, M^{(5)}] = [X, K(\mathbb{Z}, 3)^{(5)}] = [X, K(\mathbb{Z}, 3)] = H^3(X;\mathbb{Z}).$$
If such an $M$ exists, its dimension must be at least 8. Indeed, first observe that $M$ is orientable, since it is simply connected.
All orientable surfaces have trivial $\pi_3$, except for the sphere which has non-trivial $\pi_2$, so that rules out dimension 2.
Any 2-connected 3-manifold is a homotopy sphere, so this rules out dimension 3 since $\pi_4(S^3) = \mathbb{Z}_2$.
Hurewicz implies that $H_1(M;\mathbb{Z}) = H_2(M;\mathbb{Z}) = 0$ and $H_3(M;\mathbb{Z}) = \mathbb{Z}$. Poincaré duality now shows that $M$ cannot have dimension 4 or 5.
Since the Euler characteristic of an oriented $4k+2$ dimensional manifold is even, we can rule out dimension 6 by applying Poincaré duality and computing the Euler characteristic of such an $M$ to be 1.
Hurewicz also tells us that $\pi_4(M)$ surjects onto $H_4(M;\mathbb{Z})$, so $H_4(M;\mathbb{Z}) = 0$. This rules out $M$ being a 7-manifold because of Poincaré duality again.