I can easily prove the inverse, however I cannot prove this.
We know that $\operatorname{ord}_{n}(a)\mid\phi(n)$, so I have been trying to prove that $x \equiv y \pmod{\phi(n)}$ and it follows that $x \equiv y \pmod{\operatorname{ord}_{n}(a)}$.
I have also noted some relevant properties that might be of help: $$a^{\operatorname{ord}_{n}(a)}\equiv 1 \pmod n $$ $$\gcd(a,n)=1$$ $$\operatorname{ord}_{n}(a)\mid\phi(n)$$ $$a^{\phi(n)} \equiv 1\pmod n$$