Let us assume that $f:X \to Y$ is a map of connected CW complexes, having the following property: if $K$ is a finite CW complex, then the induced map $f_{\ast}:[K,X] \to [K,Y]$ on \emph{free} homotopy classes of maps is a bijection.

Question: what do I know about the map $f$?

Remarks: it is clear that if $Y$ is simply connected, then so is $X$ and thus $f$ is a weak homotopy equivalence. Tyler Lawson's answer to my old question Counterexamples in algebraic topology? proves some other cases that guarantee that $f$ is a weak equivalence. Namely, if $\pi_1 (f)$ is surjective, then $f$ has to be a weak equivalence, and surjectivity is guaranteed by $\pi_1 (Y)$ abelian or finitely generated.

I am interested in an application where the fundamental group $\pi_1 (Y)$ is nonabelian and not finitely generated, and $\pi_1 (f)$ is not surjective.

A concretely counterexample that shows that $f$ does not have to be a weak equivalence is given by the stabilization map $B \Sigma_{\infty}\to B \Sigma_{1+\infty}$.

What I hope for is the answer: $f$ will be an ''abelian homology equivalence''. This means that if $L$ is a system of local coefficients on $Y$, thought of as an $\mathbb{Z}\pi_1 (Y)$-module, such that $\pi_1 (Y)$ acts through an abelian group, then it follows that $f_{\ast}:H_{\ast}(X,f^{*}L) \to H_{\ast}(Y,L)$ is an isomorphism.

Is this true??

ifyou make the weaker assumption that $[K,X]\to [K,Y]$ is a bijection for allspheres$K$. (This would not be a weaker assumption if we were talking about based homotopy classes of course, but for unbased homotopy classes I don't know.) They construct (Example 1.2) an inclusion of discrete groups $N\to G$ such that $BN\to BG$ has this property but is not an integral homology equivalence. $\endgroup$ – Martin Palmer Dec 6 '13 at 17:13