Sebastian Larsson's stoppage-time goal enabled Martin O'Neill to mark his first match as Sunderland manager with a 2-1 come from behind win over fellow Premier League strugglers Blackburn Rovers on Sunday.
There were only six minutes of normal time left when David Vaughan's powerful shot drew Sunderland level in front of their own fans at the Stadium of Light.
And just when it seemed the hosts would have to settle for a draw, Rovers conceded a free-kick on the edge of their box and Sweden international Larsson curled a shot around the defensive wall that flew in at former England goalkeeper Paul Robinson's near post.
Victory meant Sunderland, who recently sacked Steve Bruce as their manager, climbed out of the relegation zone while Rovers remained in the bottom three.
"For periods it was a microcosm of our season, we played well enough, were not able to score and then succumb to a poor goal," said O'Neill.
"But I thought the players were terrific, the way they kept at it.
"I thought we deserved to win the game but you don't always get what you deserve. We had loads of possession and were just hoping to get that break.
"We've got some points which is vital for confidence and the crowd. The roar for the equaliser you could have heard miles away."
Vaughan, after what was only the north-east side's third league win this season, added: "The confidence was a little bit low, as you'd expect with where we are in the league, but hopefully we can get on a good run now."
Rovers midfielder Simon Vukcevic opened the scoring in the 17th minute when he headed in after Sunderland goalkeeper Keiren Westwood could only parry Christopher Samba's shot.
Sunderland should have equalised six minutes later but Kieran Richardson's shot from six yards out and his effort was well saved by Robinson.
And four minutes before half-time Sunderland nearly fell 2-0 behind when Rovers' Scott Dann out the ball in the net only for his 'goal' to be disallowed for a foul by Samba on the keeper.
"I'm really, really disappointed," said Rovers manager Steve Kean, whose side have won just two out of 15 league matches so far this term. "I felt we had a very legitimate second goal; Westwood has banged into Chris Samba and Chris is just stood there.
"I don't know why (it was disallowed). Sometimes the size of Chris Samba brings fouls for some reason when he wasn't even jumping for the ball."
Blackburn seemed content to defend their lead for most of the second half, rather than press for a second goal, and it was a policy that looked as if it would result in a precious away win until Sunderland's late revival.
Former Leicester and Celtic boss O'Neill had been out of management since ending his four-year spell in charge of Aston Villa last year by resigning from the Birmingham club.