Phantom maps provide a large class of examples of maps which are not homotopic to the constant map, but which induce the zero map on both homology and homotopy groups. There are uncountably many distinct homotopy classes of phantom maps $\mathbb{C}P^\infty\to S^3$, for example.
Edit: In many cases one can determine whether nontrivial phantom maps can be found between two spaces by investigating rational homotopy invariants. Some great references include Phantom maps and Rational Equivalences by Roitberg and McGibbon, or McGibbon's survey in the Handbook of Algebraic topology.