Garner's header opened the scoring after 18 minutes before Ash Taylor equalised for Rovers just before the break.
But Garner, leading scorer for the Lilywhites this season, took his tally to 16 goals in all competitions with a 52nd-minute effort to move Grayson's team within six points of second-placed Wolves.
"The second goal was vital, you've got to expect the home team to have some sort of spell and until 35 minutes I thought we were outstanding," said Grayson.
"We created numerous chances and you always know that you need to finish those chances.
"I thought we responded well after the Tranmere equaliser and then saw the game out in a professional manner.
"We've got a big game next week against Leyton Orient and hopefully we can go and win that one.
"We've just got to try and win as many games as possible, and if those above us slip up then we want to be there to try and take advantage of that. We'll just keep approaching each game in a positive manner.
"There was great support from the travelling fans again, the fans have travelled in their numbers all season and they've been fantastic and sometimes it can feel like a home game for the team because of the numbers they travel in."
Tranmere boss Ronnie Moore felt Rovers were masters of their own downfall.
He said: "If you look at the possession both sides have had and the goals that they've scored, it was self-destruct from our point of view.
"It was one long cross into the box - the defenders are waiting for the keeper to come - just head it clear and then moan about it. The second goal the lad had all day to stick it in where he wanted.
``But we huffed and puffed and I can't fault the effort and commitment.
"We started off 4-4-2, that wasn't working so we had to change it after 20 minutes. We brought (Jason) Koumas on, then we managed to get on the ball and play, because if we hadn't have done that then they would have had the ball all day.
"Sometimes you have to make those big decisions early on and if we hadn't we would have been in big trouble.
"But they've got better players, they're a good side. They're one of the best sides we've played."
- Sports & Recreation