Gillingham saw an unlikely three points peter out to nothing as Sheffield United struck back twice.
Despite sustained pressure from the hosts, the Gills scored with seven minutes left, to take the lead.
Gillingham, without an away league win all season, had stunned almost 20,000 home fans inside Bramall Lane thanks to an effort from Luke Norris.
But it was all-square when Michael Higdon scored for the hosts three minutes later and in the seventh minute of stoppage-time Jamie Murphy won it for the hosts.
Gills boss Peter Taylor made five changes for the trip to Sheffield United’s Bramall Lane.
Jake Hessenthaler (hamstring) and Luke Norris (knee) were both suffering injuries in the week. Both dropped to the bench, while Aaron Morris missed out completely.
It made for a new pairing in central midfield as Amine Linganzi came in for his maiden start of the season. Josh Pritchard was starting his first league game for the Gills.
Taylor’s men enjoyed a 2-1 win on their last visit to the Blades but came under sustained first half pressure on Saturday.
The visitors did have a couple of moments themselves, but home keeper Mark Howard was untroubled, as Brennan Dickenson and Cody McDonald shot wide.
Gills keeper Stephen Bywater made a couple of routine saves during the opening half but in stoppage time showed his class, with a reflex block to deny Marc McNulty. The follow-up from Harrison McGahey was blocked by Linganzi.
The Gills had conceded just twice in the previous five league games and, with Callum Davies providing an extra body in defence, they held out well in the first half.
McDonald came close to giving the Gills an early lead in the second half, as he slid onto a cross from Dickenson, but he just missed the ball.
Moments later a chance at the other end saw McNulty find a gap and shoot goalwards, only for Davies to hook the ball off the line.
Bywater dealt with another chance on the hour, when Wallace guided a header goalwards. The Gills goalie tipped the effort over the bar.
The former Sheffield Wednesday keeper was called upon several minutes later when Stefan Scougall found himself in space. Bywater dived low to keep the shot out with a great block.
A rare chance for the Gills saw Doug Loft hit a shot from 30 yards but it was weak and comfortably dealt with by Howard.
United were getting closer and closer and McNulty cracked an effort against the post with 18 minutes left. Soon after sub Michael Higdon hit the same bit of woodwork with a header.
Just as the Gills were hanging on the Gills struck. Luke Norris turned and fired a shot into the roof of the net with a chance from nowhere.
Up until that point that hosts had boasted 23 chances at the Gills goal and had 14 corners. But the Gills found themselves a goal up.
United struck back shortly after, finally beating Bywater, when from an angle, home substitute Higdon turned a cross home.
Norris had a chance to break in stoppage time but, with a clear run at goal, was brought down. The referee waved play on.
And just as the Gills looked to be claiming a point from the match Murphy ran at the defence, skipped past a couple of challenge and struck the ball home in the sixth and final minute of stoppage time.
Sheff Utd: Howard, Alcock, Wallace, Doyle, Murphy, Scougall, McNulty (Higdon 74mins), Collins, Davies (Flynn 70mins), McGahey, McEveley (Harris 70mins). Subs not used: Basham, Porter, Reed, Turner.
Gillingham: Bywater, Hoyte, Martin, Egan, Hause, Loft, Linganzi (Hessenthaler 90mins), Pritchard, Davies, Dickenson, McDonald (Norris 70mins). Subs not used: G Morris, Fish, Hessenthaler, McGlashan, German, Dack.
Attendance: 18,487 (340 Gills)