It seems to repeat every 6 values of $n$: \begin{align} 5^1 &\equiv 5 \pmod{7} \\ 5^2 &\equiv 4 \pmod{7} \\ 5^3 &\equiv 6 \pmod{7} \\ 5^4 &\equiv 2 \pmod{7} \\ 5^5 &\equiv 3 \pmod{7} \\ 5^6 &\equiv 1 \pmod{7} \\ 5^7 &\equiv 5 \pmod{7} \\ & \dots \end{align}
So it seems to depend on the divibility of $n$ by 6, but I can't figure out if there is a better pattern such as an expression in terms of $n$, or how to prove it more formally.