There are several steps implicit in doing this. You have memorized a shortcut without understanding why it works, and it is causing problems. This is why it works:
$$\boxed{\dfrac{5x^{-2}}{7y}}=\frac{5x^{-2}}{7y}\cdot\frac{x^2}{x^2}=\frac{5x^{-2}\cdot x^2}{7y\cdot x^2}=\frac{5x^{-2+2}}{7x^2y}=\frac{5x^{0}}{7x^2y}=\frac{5(1)}{7x^2y}=\boxed{\dfrac{5}{7x^2y}}$$
Now, what happens if there is a sum instead of a product in the numerator? Let's try:
$$\boxed{\dfrac{5+x^{-2}}{7y}}=\frac{5+x^{-2}}{7y}\cdot\frac{x^2}{x^2} =\frac{5\cdot x^2+x^{-2}\cdot x^2}{7y\cdot x^2}$$
$$=\frac{5x^2+x^{-2+2}}{7x^2}=\frac{5x^2+x^{0}}{7x^2}
= \boxed{\dfrac{5x^2+1}{7x^2}}
$$
So now you see what went wrong. The problem is that when there is addition involved, the extra factor you put into the top and bottom gets distributed across every term. It's because of the distributive law--that's how multiplication interacts with addition.