TITLE: Is there a functorial proof that Eilenberg-MacLane spaces are unique up to homotopy equivalence?
QUESTION [12 upvotes]: Let $(G, n)$ be a pair where $G$ is an abelian group and $n \in \mathbb{N}$. Recall that an Eilenberg-MacLane space is a connected CW complex $X$ such that $\pi_r(X) = G$ if $r=n$ and $0$ otherwise. An Eilenberg-MacLane space is unique up to homotopy equivalence. A direct argument is given in Hatcher's book based on the Whitehead theorem (that a weak equivalence of CW complexes is a homotopy equivalence): one shows that there is always an Eilenberg-MacLane space of a given form (that starts with a wedge of $r$-spheres and then goes up). Then, one explicitly checks that given any Eilenberg-MacLane space, one can define a map from this one into the other one which induces an isomorphism on the homotopy group in dimension $n$, though. This relies on a particular construction of the Eilenberg-MacLane space, though.
Is there a more functorial way of seeing this?
One half of an approach is the following. We know that the Eilenberg-MacLane spaces represent the cohomology functors (with coefficients in $G$) on $CW_*$, the homotopy category of pointed CW complexes. This implies uniqueness.
But I don't think this is logically correct given the above constraint. Namely, the fact that any Eilenberg-MacLane space represents the cohomology functor relies, I think, on the fact that any two are homotopy equivalent. Namely, the proof I know of this fits the various $\{ K(G,n) \}$  into an $\Omega$-spectrum and then argues that they represent a cohomology theory which satisfies the dimension axiom, so is singular cohomology with coefficients. I don't see how it is obvious that any $K(G,n)$ can be fit into an $\Omega$-spectrum, though, without using the homotopy equivalence above.

REPLY [3 votes]: If you accept the Whitehead theorem, then simple obstruction theory (without cohomology) determines the homotopy type of spaces with homotopy groups in only one dimension.  That is, 
you can easily show that if the only nonzero homotopy group of the CW complex $Y$ 
is in dimension $n$, then for any $(n-1)$-connected CW complex
$$
[X, Y] \cong \mathrm{Hom}( \pi_n(X), \pi_n(Y) ) .
$$
Then if the homotopy groups of $X$ are also concentrated in dimension $n$, 
an isomorphism $\pi_n(X) \xrightarrow{\cong} \pi_n(Y)$ gives rise to 
a homotopy equivalence $X\xrightarrow{\simeq} Y$.
But what if we don't want to use Whitehead?  I think you are stuck, because basic 
(model category theoretic) arguments can be used to prove Whitehead (at least for 
CW complexes with finitely many finitely generated homotopy groups?) from the uniqueness
of Eilenberg-Mac Lane spaces. 
(Prove it by induction for CW complexes with at most $n$ nonzero homotopy groups;  this requires us to convert maps to fibrations, and we don't want to end up with non-CW complexes, which is why I said we might need finitely generated homotopy groups.)
CLARIFICATION:  When I said "model-theoretic" I meant the basic facts about cofibrations, 
fibrations, induced maps, etc.  The finite generation comes in when we convert a map to a fibration:  this is done with a path space and a pullback, and these things can easily take us away from CW complexes, but my plan was to impose conditions that would guarantee we can apply Milnor's theorem (on loops of CW complexes and so on) to the CW complexes in question.