Yes, it's fine to say that $x=y$ in the second case.
If $y\in\\{x\\}$ then $y=x$, because $\\{x\\}$ is a shorthand for the unique set $U$ satisfying $\forall z(z\in U\leftrightarrow z=x)$.
And therefore $y=x\subseteq x\cup\\{x\\}$.
Yes, it's fine to say that $x=y$ in the second case.
If $y\in\\{x\\}$ then $y=x$, because $\\{x\\}$ is a shorthand for the unique set $U$ satisfying $\forall z(z\in U\leftrightarrow z=x)$.
And therefore $y=x\subseteq x\cup\\{x\\}$.