TITLE: Counterexamples for strengthening Whitehead's theorem?
QUESTION [14 upvotes]: Let $f:X\to Y$ be a pointed map of pointed connected $n$-dimensional CW complexes. Whitehead's theorem says that if $f_*:\pi_qX\to \pi_qY$ is an isomorphism for $q\le n$ and a surjection for $q=n+1$, then $f$ is a homotopy equivalence (e.g. Theorem (Whitehead) on p.75 of May's "Concise Course in Algebraic Topology"). 
I am interested in counterexamples to this when you drop the surjectivity condition for $q=n+1$. That is,

Question: What examples are there of a map $f:X\to Y$ of pointed connected $n$-dimensional CW complexes that induces isomorphism on $\pi_q$ for $q\le n$, but is not a homotopy equivalence?

I would also like to know what are the "minimal" examples of this. For example, it seems impossible for $n\le 2$ (the induced map on universal covers is a homology isomorphism by the Hurewicz theorem, and hence is a weak equivalence and thus induces isomorphism on all higher homotopy groups). I also wonder if there is an example with finite complexes.

REPLY [8 votes]: I think isos up to dimension $n$ is enough to deduce $f_*:[A,X]\to[A,Y]$ onto when $dim(A)\leq n$.  This gives a right inverse to $f$ which also induces isos up to $n$ and hence has a right inverse. So $f$ has a homotopy inverse.