I think that it is hard to say something is such a generality, as the following example shows. Take $X= \mathbb{P}^1 \times \mathbb{P}^2$ and let $C \subset \mathbb{P}^2$ be a smooth curve of genus $g$. Set $Y = \mathbb{P}^1 \times C$. Then $\pi_1(Y) = \pi_1(C)$. The latter group is trivial for $g=0$, it is isomorphic to $\mathbb{Z} \oplus \mathbb{Z}$ for $g=1$ and it is a infinite nonabelian group for $g \geq 2$.