Match ends, Gillingham 2, Tranmere Rovers 0.
Goals from Bradley Dack and Cody McDonald eased Gillingham's relegation fears and kept Tranmere within two points of the League One drop zone.
Rovers are two points above the safety line, while the Gills have moved seven points clear of the bottom four.
Dack superbly volleyed in Joe Martin's deep cross to put the hosts in front with 12 minutes remaining.
And after Tranmere sent keeper Owain Fon Williams forward for a corner, McDonald slotted in to seal the win.
Fon Williams had earlier made a series of saves to keep Rovers in the game, while the visitors close through Jake Cassidy, Jason Koumas and Jean-Louis Akpa Akpro.
Gillingham manager Peter Taylor told BBC Radio Kent:
"We needed a very important win and needed a better performance than last Saturday.
"We know what Bradley Dack is capable of - he's got great lungs and legs. At times he's been frustrated that he hasn't played so much lately, but we're happy with his work today.
"We would be unlucky to go down with 51 points, but it's still not impossible so we've got to be careful.
"I spoke to the chairman before - we're not interested in talking about next season, we're just interested in getting enough points to stay up. Once we've got enough points - then Mr [Paul] Scally has got to make a decision."
Tranmere caretaker manager John McMahon told BBC Radio Merseyside:
"It's so difficult to comprehend how we can come away with a 2-0 defeat after that performance.
"Again, a lack of concentration cost us. We gave everything we had and if there was a team that was going to win the game, I thought it was going to be us."
- 18LeeSubstituted forDackat 66'minutesBooked at 79mins
- 3MartinBooked at 35mins
- 31HessenthalerBooked at 52mins
- 8AkinfenwaSubstituted forKedwellat 70'minutes
- 5GoodisonSubstituted forHolmesat 28'minutes
- 22KoumasSubstituted forStocktonat 85'minutes
- 9LoweSubstituted forArthurworreyat 90'minutes
- Michael Naylor
- Shots on Target
Second Half ends, Gillingham 2, Tranmere Rovers 0.
Goal! Gillingham 2, Tranmere Rovers 0. Cody McDonald (Gillingham) right footed shot from outside the box to the bottom right corner. Assisted by Stuart Nelson.
Corner, Tranmere Rovers. Conceded by Adam Barrett.
Attempt blocked. Cole Stockton (Tranmere Rovers) right footed shot from outside the box is blocked.
Substitution, Tranmere Rovers. Stephen Arthurworrey replaces Ryan Lowe.
Corner, Gillingham. Conceded by Matthew Pennington.
Attempt saved. Myles Weston (Gillingham) right footed shot from outside the box is saved in the centre of the goal.
Substitution, Tranmere Rovers. Cole Stockton replaces Jason Koumas.
Jake Cassidy (Tranmere Rovers) wins a free kick on the right wing.
Foul by Joe Martin (Gillingham).
Foul by Jake Hessenthaler (Gillingham).
Jean-Louis Akpa-Akpro (Tranmere Rovers) wins a free kick on the left wing.
Corner, Gillingham. Conceded by Jean-Louis Akpa-Akpro.
Myles Weston (Gillingham) wins a free kick on the left wing.
Foul by Matthew Pennington (Tranmere Rovers).
Bradley Dack (Gillingham) is shown the yellow card for excessive celebration.
Goal! Gillingham 1, Tranmere Rovers 0. Bradley Dack (Gillingham) right footed shot from the centre of the box to the top left corner. Assisted by Joe Martin.
Attempt saved. Cody McDonald (Gillingham) header from the centre of the box is saved in the centre of the goal.
Corner, Gillingham. Conceded by Owain Williams.