John Egan's fifth goal of the season earned Gillingham a crucial away point in their promotion bid against play-off rivals Rochdale at Spotland on Tuesday.
The defender headed home from substitute Jermaine McGlashan's brilliant cross 13 minutes from time to ensure the Gills stay sixth in Sky Bet League One with just three games remaining.
Dale midfielder Callum Camps had earlier given the hosts a half-time advantage after scoring in stoppage time with a curling effort.
Gills manager Justin Edinburgh made three changes from the side that lost to Port Vale at the weekend, and reverted back to a 3-5-2 formation.
Luke Norris, Jake Hessenthaler and Bradley Garmston came in to replace Cody McDonald, Rory Donnelly and the injured Andrew Crofts in the starting XI at Spotland.
Bradley Dack started in a more advanced role up with the returning Norris, and the Gills' top scorer was nearly on the scoresheet with just four minutes played.
He latched on to a poor back pass and just made the ball ahead of Josh Lillis in goal, but the keeper did well to get down block the effort.
After a fairly scrappy ensuing 20 minutes, the biggest cheer of the first-half up to that point came midway through it as fourth official Chris Akers replaced the injured assistant referee David Benton.
It was a quiet opening for Stuart Nelson in goal, but the Gills number one did well when called into action on 36 minutes. Joe Bunney picked up the ball on the right-wing and cut inside onto his left-foot and unleashed a shot that took a deflection of Egan. The ball looked destined for the bottom corner, but Nelson’s fingertips denied the striker and the ball went out for a corner.
The visitors came again close with just five first-half minutes to play. Dack’s corner was met by captain Egan, whose acrobatic bicycle kick-turned-cross was headed over by Norris.
Yet the Gills were dealt a massive blow just before half-time as CAMPS put the hosts in front in stoppage time. He found space in the box after the Gills gave the ball away, drifted his way to the six-yard line and picked his spot past Nelson.
The second-half began with chances at both ends, but neither Donal McDermott’s header or Norris’ long range effort caused problems for either goalkeeper.
Edinburgh made changes on the hour mark with the Gills needing to an equaliser. McGlashan came on in a straight swap for Ryan Jackson and Cody McDonald replaced Aaron Morris to boost the Gills' attacking options.
Nelson was called into action again shortly after the substitutions, diving down to his right to deny McDermott doubling Dale’s advantage.
However, the Gillingham manager’s tactics proved effective with just 13 minutes remaining. After a period of pressure from the Gills, McGlashan hung up a ball to the back post where EGAN rose highest to head to ball into the corner of the net. A real striker’s finish from the centre-back.
The Gills almost had a second on 88 minutes after a well-worked free kick between McGlashan and Josh Wright. The latter swung in a ball to the back post where it was met, again, by Egan – this time, Lillis just managed to tip the header over the bar.
With momentum going into the final minutes, the Gills pushed for a winner, which would had left a seven-point gap between them and the hosts in the table.
The goal never came, and Barnsley’s late winner against Peterborough puts them on the same points as the Gills (69), however Edinburgh’s men remain in the Play-Off places with a superior goal difference.
Shrewsbury Town are the Gills' next opponents, visiting the MEMS Priestfield Stadium on Saturday (April 23rd) for our Kids for a Quid and Family Fun Day.
Rochdale: Lillis, Rafferty, McNulty, Eastham, Lancashire, McDermott (Vincenti, 70), Mendez-Laing (Andrew, 80), Allen ©, Rose, Camps, Bunney (Holt, 78)
Unused subs: Collis, Cannon, Syers, Kennedy
Gillingham: Nelson, Jackson (McGlashan, 61), Garmston, Egan ©, Ehmer, Oshilaja, A. Morris (McDonald, 61), Wright, Hessenthaler (Osadebe, 90+1), Dack, Norris
Unused subs: G. Morris, El-Abd, Dickenson, Donnelly
Referee: Mr Kevin Wright