Paolo Di Canio's side will have been disappointed not to have secured their own promotion - which was confirmed courtesy of Torquay's defeat - but they remain four points clear in the title race with two to play.
Chris Whelpdale scored twice for Gills - who maintain a notional play-off hope of their own - with Danny Kedwell kicking off the scoring and Alan McCormack grabbing Swindon's goal.
Second-placed Shrewsbury missed the opportunity to join the Robins in booking a place in League One as they drew 1-1 with Accrington. Terry Gornell and Bryan Hughes were the scorers.
Torquay slipped to fourth after goals from Rashid Yussuf and George Moncur condemned them to defeat at AFC Wimbledon. That allowed Crawley to replace them in the final automatic promotion place after a 1-1 draw at Dagenham. Charlie Wassmer put Crawley ahead only for the equaliser to arrive via Billy Bingham just before the interval.
Crewe extended their unbeaten run to 14 games to move into the final play-off place, David Artell scoring the only goal against sixth-placed Cheltenham. Oxford were the side to make way for Alexandra after their 1-1 draw at Plymouth, Asa Hall equalising for United following Robbie Williams' early opener.
At the wrong end of the table Macclesfield slipped behind Hereford to go bottom as they lost 1-0 at Bradford, with James Hanson the match-winner, while the Bulls claimed a point courtesy of a goalless draw against Northampton.
Elsewhere Aldershot drubbed hosts Burton 4-0, with goals from Peter Vincenti, Wilko Risser and two from Guy Madjo.
Port Vale beat 10-man Bristol Rovers 1-0, Marc Richards on target in the 23rd minute and Tom Parkes seeing red 16 minutes later.
Lewis Grabban was the last-gasp hero as Rotherham beat Morecambe 3-2, scoring the match-winner - and his second of the game - in added time. By that point the Millers were down a man following Ryan Cresswell's second caution. Jason Taylor scored the Rotherham's second goal, with Jordan Burrow and Jack Redshaw netting for the visitors.