Note that $N$ is  homeomorphic  to the union  of $M$ with $\DeclareMathOperator{\Cyl}{Cyl}$ the mapping cylinder $\Cyl(\pi)$ of the bundle projection $\newcommand{\pa}{\partial}$ $\pi:\pa M\to X$.  Denote by $M^\circ$ the interior of $M$ Now observe that from the Poincare Duality  for $(M,\pa M)$ we have
$$
H^{n-k}_{dR}(M)\cong H^k_{dR}(M^\circ) \cong H^k_{cpt}(M^\circ).
$$
The extension by $0$ defines a morphism  
$$
H^k_{cpt}(M^\circ)\to H^k_{cpt}(N)\cong H^k(N).
$$