James Husband rescued a point for Fleetwood Town just as they seemed set for a defeat that would damage their lingering hopes of a League One play-off place.
With Town trailing to Tom Eaves’ 84th minute header, Husband curled home a free-kick from the edge of the area that left Gills’ keeper Tomas Holy rooted to the spot.
It was a goal worthy of a point and one at odds with a scrappy game played in rainy, blustery conditions at Highbury.
Joey Barton had made two changes from the side which won at Burton Albion seven days earlier.
Nathan Sheron replaced Jason Holt in the midfield three with Ash Hunter back in the starting line-up at Ashley Nadesan’s expense.
With conditions proving tough for both teams, it was the visitors who began the brighter.
Town skipper Ashley Eastham’s misplaced backpass gave them a corner inside the opening 20 seconds and another followed as Barton’s players struggled initially.
Eaves had a shot blocked by Harry Souttar before Town finally began to settle into the game.
Hunter was their likeliest source of a goal in the opening 45 minutes, seeing one shot blocked after a driving run from Lewie Coyle.
Ched Evans had a free-kick blocked by the wall with Hunter firing the loose ball out of the ground before the best chance of the first half came Town’s way moments before half-time.
Again, the ball was worked out to Hunter on the left-hand side but, having fashioned a clear sight of goal, he saw his shot kept out by Holy’s feet.
Seven minutes into the second half and Town thought their visitors should have been reduced to 10 men when Coyle was sent through, only to be brought down on the edge of the box by Leo Da Silva Lopes.
He was only cautioned, however, and Evans fired the resulting free-kick into the wall.
With clear chances at a premium, Gillingham spurned a good one when Brandon Hanlan could not connect properly with Barry Fuller’s cross.
A better chance came on 81 minutes when Luke O’Neill twisted and turned before crossing for substitute Elliott List to head wide from six yards.
Eaves showed him how it should be done three minutes later though, heading in from another Fuller cross.
That looked to be that but then, in thee first of three added minutes, Husband stepped up to ensure the spoils were shared.
Fleetwood Town: Cairns, Burns, Eastham, Souttar, Husband, Coyle, Sheron (Nadesan 62), Sowerby, Hunter (Garrner 72), Madden, Evans. Subs not used: Jones, Holt, Biggins, Rydel, Holgate.
Gillingham: Holy, O’Neill, Fuller, Ehmer, Ogilvie, Byrne, Parrett, Burke, Da Silva Lopes, Eaves, Hanlan (list 79). Subs not used: Hadler, Charles-Cook, Reilly, Campbell, King, Rees.
Referee: Neil Hair.