Given a smooth fibre bundle of (compact, say) manifolds $F \to E \to M$, with $\pi : E \to M$ the projection, and $i_p : F \to E$ the inclusion of $F$ into any fibre $\pi^{-1}(p)$, we get, for any manifold $X$ the following sequence: $$ \mathcal{C}(M, X) \to \mathcal{C}(E, X) \to \mathcal{C}(F, X) $$ where $\Pi : \mathcal{C}(M, X) \to \mathcal{C}(E, X) $ maps $g$ to $g \circ \pi$, and $I_p : \mathcal{C}(E, X) \to \mathcal{C}(F, X) $ maps $f$ to $f \circ i_p$.
Before jumping into my question, here are a few notes. The image of $\Pi$ is all the $F$-invariant maps $f : E \to X$, that is, over each fibre $F$ = $\pi^{-1}(p) \subset E$, $f|_F$ is constant. Thus, the composition $I_p \circ \Pi$ always maps to constant maps. Furthermore, $\Pi$ is clearly injective and $I_p$ is surjective for all $p \in M$ .
And, if we define the kernel of $I_p$ to be the maps $f : E \to X$ such that $I_p (f)$ is constant, we don't get an "exact" sequence since $Im (\Pi)$ is in general a strict subset of $Ker (I_p)$. But we see that $$Im(\Pi) = \bigcap_{p \in M} Ker (I_p).$$
This begs the question, is there a way to make sense of this as a kind of short exact sequence, and thus induce a kind of long exact sequence in homotopy groups of the mapping spaces? I.e. we have $$ 0 \to \pi_0(\mathcal{C}(M,X)) \to \pi_0(\mathcal{C}(E,X)) \to \pi_0(\mathcal{C}(F,X)) \to \pi_1(\mathcal{C}(M,X)) \to \ldots$$ is exact with the appropriate induced maps from $\Pi$ and $I_p$.
This, in fact, is not true in general, as can be seen by the following counterexample. Consider the Hopf fibration $S^1 \to S^3 \to S^2$ and set $X = S^3$. Then already, at the $\pi_0$ level, $Im(\Pi_* ) \neq Ker (I_{p * } )$.
So my question, at last:
Given a smooth fibre bundle $F \to E \to M$, for what manifolds $X$ is the above sequence long exact in homotopy groups? What are necessary and sufficient conditions on $X$ for this to hold?