If $Z\subseteq Y\subseteq X$ and $Z$ is compact in $Y$, then $Z$ is compact in $X$
Your idea is good, but the symbology used is too heavy and confusing.
If $\mathcal{U}$ is an open cover of $Z$ by open subsets of $X$, then $$ \mathcal{U}'=\{U\cap Y:U\in\mathcal{U}\} $$ is an open cover of $Z$ by open subsets of $Y$.
By assumption, there exist $U_1,U_2,\dots,U_n\in\mathcal{U}$ such that $$ Z\subseteq(U_1\cap Y)\cup(U_2\cap Y)\cup\dots\cup(U_n\cap Y) $$ and this clearly implies $$ Z\subseteq U_1\cup U_2\cup\dots\cup U_n $$