Leon Legge's goal on the half-hour gave Gillingham the advantage, but that was cancelled out by Femi Ilesanmi seven minutes into the second half.
A 69th-minute penalty from Deon Burton put the Gills back in front, though, and they defended that lead to move two points clear at the top.
Vale slipped to second with a 1-0 loss at home to Morecambe, courtesy of Lewis Alessandra's 64th-minute goal.
Morecambe played the last 17 minutes with a man less after a red card for Andrew Wright but Vale were unable to find the target.
Burton moved into the automatic promotion places with a 4-0 hammering of play-off chasing Fleetwood.
Jacques Maghoma scored twice for the visitors, the first from the penalty spot, with Billy Kee and Calvin Zola adding to the tally in a dominant second-half performance from Albion.
That pushed Cheltenham out of the top three, with the Robins held to a 1-1 draw by relegation-threatened Aldershot.
Danny Rose gave the visitors a surprise 24th-minute lead but Paul Benson levelled things up midway through the second half, before Anthony Tonkin was sent off for the Shots.
Rotherham and Northampton gave their play-off hopes a boost with wins.
The Millers edged past Chesterfield 1-0 with a second-half goal from Johnny Mullins, while the Cobblers have Kelvin Langmead to thank for their 2-1 win at Southend.
Langmead scored in the final minute to snatch the points for Northampton, who had earlier taken the lead through Roy Donovan only for Matthew Lund to cancel that out.
AFC Wimbledon remain at the foot of the table but moved within a point of safety with a late 2-1 win over Capital One Cup finalists Bradford.
The Yorkshire club led through Garry Thompson, but Jack Midson evened things up seven minutes from time before Gary Alexander hit a last-minute winner for Wimbledon.
Ryan Brunt scored the only goal as Bristol Rovers beat Wycombe 1-0, and it was the same scoreline at Spotland where Rochdale saw off Torquay with a first-half effort from Rhys Bennett.
James Constable was on target for Oxford United in a 1-0 victory at Plymouth, while Barnet came from behind to claim a 2-1 win at York with goals from Andrew Yiadom and Jake Hyde.
Michael Rankine had put York ahead after seven minutes at Bootham Crescent.