We need the follwing well-known facts.
$p$ is an open map.
$Y$ is locally connected because $p$ is a local homeomorphism.
Components of locally connected spaces are open. See for example my answer to About locally path-connected spaces. Hence they are clopen (= closed and open) because components are always closed.
We conclude that $p(Y')$ is a connected open subset of $X$. Let $C$ be the component of $X$ containing $p(Y')$. Assume that $p(Y') \subsetneqq C$. The set $p(Y')$ can then not be closed: If it were, then $p(Y')$ would be clopen subset of $C$ which contradicts the connectedness of $C$. Let $x$ be a point in the closure of $p(Y')$ which does not belong to $p(Y')$. Choose a connected open neigbborhood $U$ of $x$ in $X$ which is evenly covered by $p$. Write $p^{-1}(U) = \bigcup V_\alpha$ with open $V_\alpha$ which are mapped by $p$ homeomorphically onto $U$. The $V_\alpha$ are therefore connected. By the choice of $x$ we have $U \cap p(Y') \ne \emptyset$. We conclude $p^{-1}(U) \cap Y' \ne \emptyset$. Thus $V_\alpha \cap Y' \ne \emptyset$ for some $\alpha$. Hence $V_\alpha \cup Y'$ is connected. Since $Y'$ is a component of $Y$, we must have $V_\alpha \subset Y'$. Thus $x \in U = p(V_\alpha) \subset p(Y')$. This contradicts the choice of $x$.
Therefore we must have $p(Y') = C$.