If two CW complexes have isomorphic homotopy groups, are they homotopy equivalent? [duplicate]

I denote with $\pi_{i}$ i-homotopy group. If I have $X,Y$ CW-complex and $\pi_{i}(X)=\pi_{i}(Y)$ for all $i$. Can I say that $X$ and $Y$ are homotopic equivalent? What type of equivalence is it?

-

marked as duplicate by Grigory M, Sami Ben Romdhane, TMM, Nick Peterson, Claude LeiboviciJan 19 '14 at 14:24

IIRC, if you have a map $f:X\to Y$ that induces isomorphisms on all homotopy groups, then it is a homotopy equivalence. –  Olivier Bégassat Jan 21 '13 at 2:01
–  Martin Jan 22 '13 at 0:10
Moreover, please see: How do I accept an answer? and Why should we accept answers? –  Martin Jan 22 '13 at 0:17

You cannot say that $X$ and $Y$ are homotopy equivalent if $\pi_i(X) = \pi_i(Y)$ for all $i$. This is because the definition of homotopy equivalence requires that there is some continuous map $f: X \longrightarrow Y$ that is invertible up to homotopy. Hence the isomorphisms $\pi_i(X) \cong \pi_i(Y)$ need to be induced by such a homotopy equivalence $f$.
The standard counterexample is $X = S^2 \times \Bbb R P^3$ and $Y = S^3 \times \Bbb R P^2$. These groups have isomorphic homotopy groups (this follows from the fact that they both have fundamental group $\Bbb Z/2$ and universal cover $S^2 \times S^3$), but $H_5(X) \cong \Bbb Z$ and $H_5(Y) \cong 0$ as $X$ is compact and orientable but $Y$ is compact and nonorientable. Homotopy equivalent spaces have isomorphic homology groups, so we see that $X$ and $Y$ in this example could not possibly be homotopy equivalent.
If there is a continuous map $f:X\to Y$ which induces an isomorphism $\pi_i(X)\stackrel{\sim}{\to} \pi_i(Y)$ for every $i\geq 0$, this map $f$ need not be a homotopy equivalence for arbitrary topological spaces $X$ and $Y$, but it is by definition what is called a weak homotopy equivalence. However, it is a theorem of Whitehead that if $X$ and $Y$ are both connected and homotopy-equivalent to CW complexes, then any weak homotopy equivalence between them is in fact a true homotopy equivalence.
To answer your question as written, even if $\pi_i(X)\cong\pi_i(Y)$ for each $i$, there need not be a map $f$ which induces these isomorphisms, and they need not be homotopy-equivalent. There is an example in the Wikipedia article on the Whitehead theorem, linked above.