We can set up the system of equations:
x = y - 2
5x - 4y = 10
And we will see that the numbers are 18 and 20.
How to find the two numbers?
Let's say that the smaller number is x, and the larger one is y.
We know that:
x = y - 2
5x - 4*y = 10
So we have a little system of equations, replacing the first equation into the second one we will get:
5*(y - 2) - 4y = 10
5y - 10 - 4y = 10
y - 10 = 10
y = 10 + 10 = 20
And:
x = 20 - 2 = 18
So the two numbers are 20 and 18.