While closest rivals Port Vale were being held at home by Dagenham and Redbridge, the Gills eased into a 2-0 lead through Deon Burton and Jack Payne, and survived the late drama after Adebayo Akinfenwa had reduced the deficit.
Vale were fortunate to escape with a point against the east Londoners, who snatched a 72nd-minute lead through Luke Howell, only for Jennison Myrie-Williams to equalise for the hosts within three minutes.
Torquay staged a spectacular comeback from 3-0 down as they scored twice in the last six minutes and beat Aldershot 4-3 at Plainmoor.
Craig Reid's 47-minute hat-trick seemed to have victory sewn up for the visitors before Billy Bodin and Ryan Jarvis gave the Gulls a chance. Ashley Yeoman then equalised with an 84th-minute header, and Rene Howe poked home an 89th-minute winner from close range.
New boys Fleetwood stay third after a convincing 2-0 win at York, Junior Brown giving his side a 36th-minute lead from long range and Steven Gillespie adding the second on 87. Meanwhile, Jamie Cureton's double gave Exeter a 2-1 win at rock-bottom Barnet, for whom Jake Hyde replied in the 81st minute.
Managerless Wycombe took an early lead against Plymouth at Adams Park when Matt McClure headed home a cross by caretaker-boss Gareth Ainsworth, but Argyle equalised five minutes into the second half through Guy Madjo for a 1-1 draw.
Oxford twice came back from behind to beat AFC Wimbledon 3-2. The Dons led 2-1 at half-time through Jake Forster-Caskey and Jim Fenlon while Byron Harrison replied for the hosts. Oxford won it in the second half with Deane Smalley equalising again in the 55th minute and Alfie Potter taking the points nine minutes from time.
Jacques Maghoma fired home a long-range free-kick in injury time to give Burton Albion a 1-0 win at Southend, who had played with 10 men since the 10th minute, when John Spicer was sent off for a foul on Matthew Paterson.
And Rochdale clung on for a goalless draw against Bradford at Spotland despite having Bobby Grant dismissed 10 minutes before the break. Goals from Gary McDonald and Lewis Alessandra gave struggling Morecambe a 2-0 win at home to Chesterfield, while Accrington Stanley's game against Rotherham was postponed.