"Just a few pounds" is a lot for a 20- to 30-pound dog. A vet put this in perspective after my aging (and spreading) GerShep successfully lost some serious overweight: he said (with congratulations), "That's xx% of her weight." (Sorry, I can't recall the precise figure just now.)
So let's say a dog should weigh about 23 pounds and she gains 5 pounds: that's a substantial proportion of her normal weight. If her human normally weighs, say, 125 pounds, the dog's 5-pound increase would be (proportion-wise) the equivalent of the human gaining a little over 27 pounds. Yipes!
Pooches, like humans, need less food as they age. I'd either look for a "senior" style dog food or simply feed a little less food. Feeding less food overall but offering it more often during the day may help the dog feel less put-upon, just as it makes us old buzzards feel less deprived. ;-)
I started feeding my 2 seniors the Blue Buffalo in the yellow bag...it's not a senior food but a weight maintenance. I also cut down the amount and added chicken (I use canned, 98% fat free) and no salt added canned veggies for dinner and no fat cottage cheese or yogurt for breakfast. The majority of their treats are carrots. I also feed my almost 5 yo corgi the same. My Max kept his fighting weight right to the end at age 13, Katie is 11 and her weight is perfect.
Thank you for mentioning the Carrot Treat. Cassie and Ruby lobby for their carrot shortly after breakfast. They love it...but I've been a little afraid that maybe a raw carrot is "not dog food"??? It doesn't seem to give either one the doggywobbles, though. They love it and do a little Dance to Spring every time a carrot comes out of the fridge. And secretly I hope that maybe a crunchy carrot or piece of apple might help to scrape the teeth a wee bit cleaner.
A dog at 7 is still in her prime and she should not be gaining weight for no reason. Look carefully at lifestyle factors. Is she getting the same amount of exercise? Is she sleeping more? Is she getting more treats and/or finding a source of food that you are not aware of?
If NOTHING has changed and she's gaining weight on the same food she used to maintain on, personally I would have thyroid checked and run a blood panel to make sure nothing else is going on, before you start switching food.
My guys get the same amount of food now at 8 and 11 as they did when they were 2 and 4. We actually had to up Maddie's food a bit because she was losing weight, but she is in a cart and is slowly losing muscle mass behind so that may be most of it.
@Vicky....my corgis get carrots as their main treat and have for years. Where did you ever hear it causes doggy wobbles?