It was the Minstermen who threatened first through loan signing Michael Rankine as his header from Jon Challinor's long ball was well gathered by Stuart Nelson at Bootham Crescent.
The Gills fired back and wasted a glorious chance with Cody McDonald shooting wide from an acute angle, despite having Deon Burton in space inside the area.
Prior to half time, Rankine was denied once again as his header from Ashley Chambers' corner was blocked on the line by Leon Legge.
After a quiet opening period, Gillingham almost took the lead but Michael Ingham tipped Andy Frampton's long range effort past the post.
The Gills then missed the chance of the match as McDonald headed wide in the area following a terrific delivery from Joe Martin.
In the closing minutes, the Gills thought they had grabbed the win, but Charlie Lee struck the crossbar from distance with his first touch of the match.