A lot of algebra boils down to doing the same thing to both sides of an equation. For instance, if I started with the equation:
$$x=y+1$$
I could subtract $1$ from each side to get
$$x-1=y+1-1$$
which doesn't look that useful - except that using what I know about addition and subtraction, I can figure out that $y+1-1$ must equal $y$ to deduce a more useful expression:
$$x-1=y.$$
It's easy to learn this sort of manipulation by rote, but what we're doing is just cleverly using a fundamental property of equality: if two things are equal, I can do the same operation to both, and they will remain equal.
I could do other correct manipulations, if I wished - I could double each side to get
$$2\cdot x = 2\cdot (y+1)$$
which would simplify to
$$2\cdot x = 2\cdot y + 2.$$
Would this be useful? Probably not - but it's certainly legal. The trick with solving algebraic equations is that you choose your manipulations cleverly - you try to sort of "unwrap" the variable you wish to solve for, usually by undoing whatever operations were applied to it. I mention this because it's important to remember that we're not just shuffling terms about from side to side - to get from $x=y+1$ to $x-1=y$, I didn't magically move a $1$ from one side to the other - I subtracted from both sides in a way that conveniently made $y+1-1$ and then cancelled.
In the given example, removing the $\sin$ since it isn't at fault here, if I start with:
$$x=5y+2$$
It's absolutely true that there are multiple ways to start: One way is to start by subtracting $2$ from both sides giving
$$x-2=5y+2-2$$
$$x-2=5y$$
and then dividing both sides by $5$ to get
$$\frac{x-2}5=\frac{5y}5$$
$$\frac{x-2}5=y.$$
This is a nice sequence to go about it, because $5y+2$ means "take $y$, multiply it by $5$, then add $2$" and if I want to undo that sequence of operations, I just undo each operation in reverse order - that is, "subtract $2$, then divide by $5$".
But, you're right that you can start in other ways: if I divide both sides by $5$, I get
$$\frac{x}5=\frac{5y+2}5$$
which would then simplify as
$$\frac{x}5=y+\frac{2}5.$$
This step - from (6) to (7) in your reasoning - appears to be where the issue arises. From there, I could subtract $\frac{2}5$ from both sides as
$$\frac{x}5-\frac{2}5=y+\frac{2}5-\frac{2}5$$
$$\frac{x}5-\frac{2}5=y$$
which is equivalent.
As long as you take both sides and do the exact same thing to each of them, you'll arrive at a correct statement at the end*. Succinctly put, the property we're using is that if $L=R$ then $f(L)=f(R)$ for any function $f$ - where that function could be "add $2$" or "divide by $5$" or anything else we might dream of. Algebra is just knowing the correct thing to do so that at the end your result is useful.
(*Caveat: Sometimes students will assume this goes both ways, but if you do something like "square both sides" you can end up with extraneous solutions. It's still true that if $L=R$ then $L^2=R^2$, but it's not true that if $L^2=R^2$ then $L=R$. This doesn't come up with adding and subtracting stuff from both sides or multiplying by non-zero coefficients since you can undo those operations)