For a more explicit example than Chris's, consider the map from the (2-dimensional) torus to a sphere that collapses the 1-skeleton of the usual CW complex and takes the 2-cell to the 2-cell of the sphere.  The torus is $K(\mathbb{Z}^2,1)$, so this necessarily gives zero maps on homotopy, but it's also pretty clearly not null-homotopic.