Suppose $M$ is a connected compact topological manifold.
If you consider a closed connected 1-dimensional manifold $X$, then it's homeomorphic to a circle $X\cong \mathbb{S}^1$. Let's denote $[X,M]$ the space of classes of continous functions $f:X\rightarrow M$ up to homotopy. It's easy to see that: $$ [X,M]\cong\pi_1(M) $$
My question is: if you have a closed connected and orientable 2-dimensional manifold $X$ (which can be classified by its genus $g$). Can $[X,M]$ be fully characterized by $g$, $\pi_1(M)$ and $\pi_2(M)$? If not, are there two manifolds $M_1,M_2$ with identical fundamental and second-homotopy groups but such that $[X,M_1]\neq [X,M_2]$ for some genus $g$?
In some sense, if we define $\pi_2^g(M)=[X,M]$, then it generalizes $\pi_2(M)$ with $\pi_2^0=\pi_2$. My question can also be thought as asking: do we gain any new topological information about $M$ by considering $\pi_2^g$?