Are maps inducing the same cohomology homomorphisms homotopic?

It is not hard to show that given $f,g: X \rightarrow Y$, with $f$ and $g$ homotopic the induced homomorphisms $f^*, g^* : H^* (Y, \mathbb{Z}) \rightarrow H^* (X, \mathbb{Z})$ are the same.

Is the converse true? i.e. if $f^* = g^*$ then is it necessarily true that $f$ and $g$ are homotopic?

I'm sure this is far too strong to hold in general. But I'm particularly interested in the case where $X$ and $Y$ are finite CW-complexes. I feel that results like CW-approximation make it plausible that such a result may hold. I just can't see how to prove it or how to construct a counterexample.

Thanks.

-
How would you show the statement in your first sentence, though? Also, by $H^{\ast}$ you mean the cohomology group, right? – Ryker Dec 2 '15 at 4:09

This is not true; for instance, every map $S^3 \rightarrow S^2$ induces the trivial map on cohomology. However, you can detect nontriviality by taking the (homotopy) cofiber of the map, i.e. attach a 4-disk to $S^2$ along the image of $S^3$. For the trivial map this gives you $S^2 \vee S^4$, whereas for instance the Hopf fibration will give you $\mathbb{C}P^2$. To be totally precise, you can tell that this is distinct from $S^2 \vee S^4$ by checking that the self-cup product of the 2-dimensional generator $\alpha$ is nontrivial -- in fact, it's a 4-dimensional generator $\beta$. In general you get that $\alpha \smile \alpha = n\beta$ for some $n \in \mathbb{Z}$. This $n$ is called the Hopf invariant of the map; the Hopf invariant can be defined for any map $S^{2k-1} \rightarrow S^k$, and in fact defines a homomorphism $\pi_{2k-1}(S^k) \rightarrow \mathbb{Z}$. It's rather easy to show that this always hits the even integers when $k$ is even and is trivial when $k$ is odd. With a little more work, you can show that if this is surjective, it must be that $k=2^t$. But in fact, it's surjective precisely when $k \in \{1 , 2, 4, 8\}$, and moreover this is actually equivalent to the statement that the only real division algebras are the real numbers $\mathbb{R}$, the complex numbers $\mathbb{C}$, the quaternions $\mathbb{H}$, and the octonions $\mathbb{O}$!