Let $\pi:X \rightarrow Y$ be a double cover between compact manifolds $X$, $Y$ and $\theta$ be the deck transformation. Let $H^2(X, \mathbb Z)^\theta$ be a group of $\theta^*$-invariant elements in $H^2(X, \mathbb Z)$.

My Question is:

Is $H^2(X, \mathbb Z)^\theta$ a subset of $\pi^* (H^2(Y, \mathbb Z) )$?

You can assume that $X$ is a simply-connected projective variety if necessary.

Thanks!