In your case the "confounding" does not matter. Your within-subject / repeated measures data collection design comes in as a fortune. In your problem we define $W=X-Y$, so you are interested in testing $H_0: E(W) \le 0$. Your sample gives you this information. You can use a one-sided t-test to solve this problem.
There is also formally no causal problem. There would be a causal problem if you were interested in estimating $p(X|do(Y=y))$, for example, in which case you would need to integrate over $Z$ in order to arrive at the correct estimate:
$$p(X|do(Y=y)) = \sum_Z p(X|y,Z)p(Z)$$
As you are interested in means this process would involve estimating $E(X|y,Z)$$E(X|Y,Z)$ using regression (for example and under assumptions of e.g. linearity), make a prediction of expected outcome $\hat{E}(X|y,z_i)$ for all $i$ observations in your sample, and then average across all estimates.
However, in your case you are interested in the difference of the expectations of the marginal distributions of $X$ and $Y$, so that confounding is irrelevant.
Another causal inference problem emerges if we modify your data collection design to a 'between-subject' design, where for each subject you only observe $X$ or $Y$, so that $W$ cannot be computed for each observation from the data. Let $T=0$ indicate that $X$ is observed and $T=1$ that $Y$ is observed and let $U=TY+(1-T)X$ be the observed outcome. Furthermore, assume $T$ depends onlyis statistically dependent on $Z$. If now you want to estimate $E(W)$ you face the classical causal inference problem discussed in observational epidemiological research where treatment assignment is dependent on observed confounders. Now we need to estimate
$$E(W)=E(U|do(T=1))-E(U|do(T=0)) = \sum_Z [E(U|T=1, Z)-E(U|T=0, Z)] p(Z)$$$$E(W) =E(U|do(T=1))-E(U|do(T=0)) \\ = \sum_Z [E(U|T=1, Z)-E(U|T=0, Z)] p(Z)$$
which then could be estimated in similar fashion as discussed above. However in your case this scenario does not apply; I merely make the case to show how your problem differs from one of the 'classical' causal inference problems (observed confounding / confounding by indication).