That should be fine.
A bonus would not change your base pay, which is what TSP matching is based on (overtime does not change tsp contribution/match either). When would you get your pay raise? Or are you thinking mid-year promotion type of pay raise?
As for the match, yes, 5% contribution gets the 5% match (auto 1% whether you contribute or not, then 1% match for you first 3% of contribution, and 1/2% for your next each 1% contribution.)
Our raises are supposed to happen in June, but we've had years where we didn't know what our raise would be until well into the next year, and then we get a bunch of retro pay. I'm at the point now where I don't want that raise to finally show up in November, push me over the limit with the retro pay, and end up losing any match at the end of the year, so I just contribute a dollar amount each paycheck instead of a percentage. The dollar amount I contribute is still well over 5%, so I know I would not lose any matching, and it isn't some weird mystery involving retro pay and multiple corrections to fix it when the raise is late.