The answer is yes, assuming $Y$ is smooth: this follows from the identification $$ \operatorname{Ker}(H^n_c(X,\mathbf Q_\ell) \to H^n_c(Y,\mathbf Q_\ell)) = W_{n-1}H^n_c(X,\mathbf Q_\ell),$$ where $W$ denotes the weight filtration. Clearly any element of $W_{n-1}$ is in the kernel, since the image of the map is pure of weight $n$. For the reverse inclusion use the long exact sequence of the pair in compact support cohomology to see that the kernel is the image of $H^{n-1}_c(Y \setminus X,\mathbf Q_\ell)$, which is of course of weights $\leq n-1$.
Dan Petersen
- 40.2k
- 2
- 114
- 201