Substitute Nathan Broadhead scored in added time on his comeback from injury to rescue Sunderland and fire the Black Cats back into the play-off places. The Wearsiders looked destined for a second successive goalless draw as they toiled in vain against struggling Gillingham at the Stadium of Light, and more dropped points would have put their chances of a place in the play-offs in real jeopardy.
Luke O'Nien had headed against the post and Patrick Roberts had brought a good save out of Aaron Chapman in the first half, but Sunderland could not find a way through and it looked as though they had run out of time. That was until on-loan Everton striker Broadhead marked his return with the all-important goal in the fifth minute of added time.
The win saw Sunderland leapfrog next week's opponents Oxford to go sixth in the table, a point clear of the U's. And it kept Alex Neil's side firmly in the play-off race.
Go here for all the latest Sunderland AFC news
Neil made two changes to the side that drew at Lincoln last time out, with Alex Pritchard and Danny Batth returning from injury, and they replaced Dan Neil and Lynden Gooch. Gillingham boss Neil Harris was forced into one change to the side that won at Accrington Stanley last Saturday, with Stuart O'Keefe missing out through injury and his place taken by teenager Josh Chambers who was making his first League start.
Sunderland dominated the first half but struggled to fashion clear-cut chances against the Gills defence. Jack Clarke had an early half-chance but failed to make good contact, allowing Chapman to make a simple save, and Pritchard curled an effort over the top from 25 yards.
O'Nien went closest midway through the half when he met a Clarke cross with a flicked header which beat Chapman but hit the bar and went over. A few minutes later, Roberts cut into the penalty area from the right and brought a good stop out of Chapman, who dived to his right to push the ball clear.
Gillingham's only effort of any real note in the first period saw Charlie Kelman blaze a shot over the bar from a tight angle inside the penalty area on the left. In the second half, Pritchard sent another shot narrowly over the angle of post and bar.
And from a corner, Batth saw a header strike a Gillingham defender but somehow the visiting defence prevented it crossing the line and scrambled it behind for another corner. Neil made a triple change midway through the half in an attempt to spark his side into life, with Broadhead, Lynden Gooch, and Elliot Embleton replacing O'Nien, Pritchard, and Carl Winchester.
A rapid break down the right-hand channel by Roberts ended with the ex-Manchester City man setting up Corry Evans on the edge of the box, but his shot went just over the bar. In injury time, Jack Tucker made a brilliant block to deny Ross Stewart after the striker had got on the end of Gooch's low ball into the box.
But in the fifth minute of the six minutes added on, Sunderland finally made the breakthrough as two of the subs combined. Embleton's cross from the right found Broadhead, and he got above Tucker to nod the ball back across Chapman and into the right side of the net to win the game.
How they lined up
Sunderland: Patterson, Winchester (Gooch 68), Wright, Batth, Cirkin, Evans, O'Nien (Embleton 68), Roberts, Pritchard (Broadhead 68), Clarke, Stewart. Subs not used: Hoffmann, Xhemajli, Neil, Matete
Booked: Cirkin, Broadhead
Gillingham: Chapman, Tucker, Ehmer, Masterson, Jackson, Chambers (Reeves 72), Thompson, Lee, Tutonda, Kelman (Akehurst 90), Oliver. Subs not used: Dahlberg, Maghoma, Dickson-Peters
Booked: Lee, Tutonda, Chambers, Reeves
Referee: Oliver Langford (West Midlands)
Attendance: 31,619
For the latest Sunderland news direct to your inbox, go here to sign up to our free newsletter