The already-promoted Gills drew 2-2 to seal their first silverware since 1964 after they claimed the point they needed at home.
Deon Burton and Danny Kedwell gave the newly-crowned champions a 2-0 lead at home over struggling Wimbledon, who are now one point adrift of safety ahead of their final game of the season against Fleetwood.
Jack Midson and Jon Meades both scored after the break for the visitors but they were unable to find a much-needed third goal which would have lifted them out of the relegation zone.
Port Vale have all-but joined Gillingham in celebrating their promotion after Lee Collins' late own goal for Northampton saw the Valiants draw their game 2-2.
Vale are three points clear of Cheltenham in fourth with a goal difference of 28 in their favour ahead of the final day of the season.
Clarke Carlisle scored the opening goal for Northampton in the second minute although Liam Chilvers equalised for Vale before the half-time whistle.
After the break, Northampton took the lead again through Roy O'Donovan, but Collins' error gifted Vale a point which almost pushed them over the finish line of automatic promotion.
Bottom side Aldershot avoided relegation on Saturday with a 1-0 win against fellow strugglers Dagenham & Redbridge thanks to Michael Rankine's second-half strike.
They are now three points adrift of Barnet, who scored a late winner in their final match at Underhill to climb out of the bottom two.
Jake Hyde scored for Barnet in the 81st minute although Wycombe missed the chance to level with a last-gasp penalty when Joel Grant was denied by goalkeeper Graham Stack in injury-time
York also earned a vital three points in their bid to avoid relegation to the Blue Square Bet Premier League as they beat Southend 2-1.
Adam Reed scored a right-footed volley in the first minute before Ryan Leonard cancelled it out for Southend midway through the first half.
Matty Blair, however, was on hand for York before the half-time whistle to secure a crucial win for his side when his volley sealed the win which lifted them two points clear of Wimbledon.
Meanwhile, Rotherham held onto third place thanks to their 1-0 win at Plymouth.
Kieran Agard scored from close range in the 76th minute to put Rotherham two points clear of Cheltenham, who kept themselves in the hunt for automatic promotion with a 1-0 win at Exeter.
Russell Penn was the only man to get on the scoresheet in that match, with the final automatic promotion place to be decided on the last day of the season.
Bradford moved into the top seven with a 1-0 win over 10-man Burton.
James Hanson scored from close range late in the first half before Burton midfielder Lee Bell was sent off for a challenge on Zavon Hines.
Oxford comfortably beat Rochdale 3-0 at home thanks to second-half strikes by Andrew Whing, James Constable and Alfie Potter.
Elsewhere, Lee Molyneux's 35-yard free-kick saw Accrington Stanley beat Bristol Rovers 1-0, while Torquay moved away from the relegation zone with a much-needed 2-0 win over 10-man Morecambe.
Chris Doyle was sent off for Morecambe in the 24th minute before Stewart Drummond's own goal four minutes later gave Torquay the lead.
Ashley Yeoman sealed the win for Torquay midway through the second half to leave them two points clear of the bottom two.
Finally, Chesterfield beat Fleetwood 3-1 at Highbury.
Armand Gnanduillet headed the Spireites into a 44th-minute lead with Marc Richards adding their second in first-half stoppage time.
Richards scored another midway through the second half before Andy Mangan scored a consolation for Fleetwood.