How do we know the number five means Grace? What is the general rule to interpreting numbers?
Any number has a meaning only because we see its pattern routinely in the scriptures. So the meaning is inferred by the context, but we can validate the meaning of any number by searching for occurrences of that number to see if it matches the pattern. For example, not every mention of "five" is specifically talking about grace, just as not every mention of "seven" is necessarily going to reinforce completeness, yet often it will.
With the number "five", the concept of grace is often harder to see in the text so we need to study deeper to see the connection. For example, if you found a passage in scripture (Revelation 9:5) mentioning five months of pain, you might ask yourself how it connects to the theme of grace. But when you look deeper you realize that it actually means five months of not being able to die in a time when everyone is dying…that’s grace, albeit a subtle inference you might miss the first time reading through.
So generally, you find the meaning of numbers in scripture by the pattern of their usage. And the common view states "five" is the number of grace because of how often it shows up as such.