Jamie Murphy rescued Sheffield United with a 97th minute winner at Bramall Lane.
The Blades dominated the League One game with one-way traffic in the second half as they kicked towards the Kop.
United hit the woodwork twice, Gills goalkeeper Stephen Bywater pulled off some outstanding saves, but the hosts could not score.
And when Luke Norris popped up with a tremendous volley with six minutes remaining it looked to the perfect sucker punch.
But United equalised inside three minutes when Michael Higdon nipped in at the near post to convert Craig Alcock’s cross.
And in stoppage time, Murphy capped a superb indvidual run when he slotted home beyond a stranded Bywater.