If $f,g:X_1\rightarrow X_2$ are homotopic, then they induce the same maps of homotopy groups $f_*=g_* : \pi _n(X_1)\rightarrow \pi _n(X_2) $. The opposite is not true. For instance if $X_1=\mathbb{RP}^n$, $X_2=K(\mathbb{Z}_2,2)$, then the only non trivial homotopy group of $X_2$ is $\pi_2(X_2)=\mathbb{Z}_2$ and since $\pi_2(\mathbb{RP}^n)=0$ any map $f: \mathbb{RP}^3\rightarrow K(\mathbb{Z}_2,2)$ induces trivial maps $f_*$, however since $H^2(\mathbb{RP}^3,\mathbb{Z}_2)=\mathbb{Z}_2$ is equivalent to the set of homotopy classes of maps $f:\mathbb{RP}^3\rightarrow K(\mathbb{Z}_2,2)$ there must exist a homotopically non trivial $f$.
I was wondering if there exists some additional condition on top of $f_*=g_*$ which guarantees that $f$ and $g$ are homotopic.