SecondInt are your 2 integer variables, and
Thresh is an integer variable indicating how much of a gap you want to allow (in your case 5), you can check for this gap in If condition
FirstInt <= SecondInt AndAlso FirstInt + Thresh >= SecondInt. This checks that the first integer is equal to the second one, or no less than whatever
Thresh is set to.
If you want the check to pass if the difference between
SecondInt is a number like 5 regardless of which number is larger, (e.g.
FirstInt can be 104 and
SecondInt can be 99), then you need the If condition to be
(FirstInt <= SecondInt AndAlso FirstInt + Thresh >= SecondInt) OrElse (FirstInt >= SecondInt AndAlso FirstInt <= SecondInt + Thresh).
Using a variable like
Thresh allows you to easily configure the difference you want to accept between the values.