Suppose mappings $$ M \to P_{1}, \quad M \to P_{2}, $$ where $M$ is some manifold, while $P_{1,2}$ are in general different spaces. I want to clarify if there exists a lifting between these two mappings.
Suppose $M = S^{n}, n > 1$. Then have I to compare the homotopy groups $$ \pi_{i}(P_{1}) \ \ \text{with} \ \ \pi_{i}(P_{2}), \quad i = 1, ...,n, $$ or only $$ \pi_{n}(P_{1}) \ \ \text{with} \ \ \pi_{n}(P_{2})? $$
I assume you are looking for a morphism $h: P_1\to P_2$ such that $h\circ f = g$, where $f:M\to P_1$, $g:M\to P_2$ denote your morphisms. Since every object is fibrant with respect to the Quillen model structure on the category $Top$ of topological spaces and continuous maps, it is enough to check that $f$ is an acyclic cofibration.
To answer your question, it means that in particular ($\textbf{but it is not sufficient}$) you have to check that $f$ is a weak homotopy equivalence, meaning that for all $x\in M$ and for all $n\in\mathbb{N}$, $$f_{*}: \pi_n(M,x)\to\pi_n(P_1,f(x))$$ is an isomorphism.
Note that if you assume your manifold $M$ to be $S^n$ for some $n$, then (at least for $n\geq 2$) the homotopy groups $\pi_i(S^n,x)$ are not zero in general, hence you have to compare possibly non-trivial homotopy groups $\pi_i(S^n,x),\, \pi_i(P_1,f(x))$ for all $x\in S^n$ and for all $i\in\mathbb{N}$.
Fortunately, there is a shortcut. Indeed, as I mentioned it is enough to check that $f$ is an acyclic cofibration with respect to the Quillen model structure, meaning that $f$ is a retract of a transfinite composition of pushouts of morphisms among the set of inclusions $\lbrace D^i\rightarrow D^i\times I \,|\, i\geq 0\rbrace$ (the inclusions that map $x$ to $(x,0)$). In particular, this is the case if your space $P_1$ is obtained from $M$ by glueing (possibly infinitely many) cylinders along disks, and $f$ is the inclusion from $M$ to $P_1$.