Yes. Always try to keep to inflation, or a little under, because stuff happens. You might one day really need to raise the rent (unanticipated repairs, unanticipated code change enforcement, etc.), and if you hadn't already been doing that on a regular schedule, you'll suddenly be the Bad Guy (cue the Villain Theme dun dun duuuun!).
Obviously, if it's a choice between keeping a good tenant and raising the rent, keeping a good tenant should take priority, so you don't have to keep up strictly with inflation, e.g. it doesn't need to be 5 or 7 or 20% or whatever. But yes, raise it every 12 or 18 months, at least by the price of a cup of coffee, just so that it will be expected.
Another aspect is trapping the tenant in an under-market rent. I've heard of this happening, like the rent is never raised for whatever reason, then 20 years later they're paying a third of market or some such. Yes, a good tenant stays, but the tenant doesn't necessarily want to stay for whatever reason, but the rents everywhere else is three times as much. They're trapped!
Then later on you need to sell the place. So guess what's going to happen? The rent is going going go up by at least three times as much, and the tenant will be extremely unhappy. A percentage raise is bad enough, but a jump from the market rate of 20 years ago to today's rate is heart stopping.
So again, yes, raise the rent. You don't have to raise it to market, but you have to raise it. It's better for everybody in the long term.