Victory would have put the Gills back to a point above Port Vale but instead they lie one off the summit.
Struggling York are now winless in eight games but will be heartened by Tuesday night's result.
Cheltenham climbed into the top three after their 2-1 away success at Southend.
Marlon Pack's 13th-minute penalty and Paul Benson's 38th-minute attempt gave them control, while Ben Reeves struck in the closing moments for the hosts.
Fleetwood also harbour automatic promotion hopes and they defeated Oxford United 2-1 at the Kassam to go fourth.
Ryan Crowther (28) and Junior Brown (55) scored for Town before Liam Davis pulled one back a minute from time.
Rotherham were 3-1 winners against Torquay at Plainmoor.
Lee Frecklington and Alex Revell made it 2-0 after an hour before Kayode Odejayi and Billy Bodin traded last-gasp goals.
Wycombe went down 3-0 to guests Bradford, who scored in the first minute through Nathan Doyle and twice in the last 10 through Will Atkinson and Doyle's penalty.
Morecambe defeated Aldershot 2-1 as an own-goal from Oliver Risser and Gary McDonald outweighed Danny Hylton's late effort.