$[X,Y]$ is finite where $X$ is finite connected CW-complex, and $Y$ has finite homotopy groups

Here is a comment from the author of the book you mention. I thought it might be relevant, however too long for a comment.

The argument I had in mind was induction on the number of cells of X, but not explicitly using a cofiber sequence. Suppose X is obtained from a subcomplex X' by attaching an n-cell. Given a map f : X ---> Y, induction implies that f is homotopic to a map whose restriction to X' is one of a finite number of possible maps g_1, … ,g_k : X' ---> Y. It suffices to show that for each g_i there are only finitely many possible extensions f : X ---> Y, up to homotopy. Fix one such extension f_0, and let f be any other extension. The compositions of f_0 and f with a characteristic map for the n-cell give maps D^n ---> Y that agree on S^{n-1}, so they give a "difference" map d(f,f_0) : S^n ---> Y. We will use the following elementary fact:

Lemma: Suppose we are given two basepoint-preserving maps from S^n to a space Z that agree on a disk D^n containing the basepoint. Then if the two maps define the same element of pi_n(Z), they are homotopic by a homotopy that stays fixed on D^n.

Thus if pi_n(Y) is finite, there are only finitely many choices for f, up to homotopy fixing X'.

Allen Hatcher

He wrote this email as response to a friend of mine who contacted him after we had doubts solving this exercise.