Sylvan Ebanks-Blake's late strike sealed a precious 3-2 victory for Wolves against Sunderland in a dramatic encounter at Molineux.
Kevin Foley's goal five minutes into the second half had put Wanderers 1-0 up before efforts from Darren Bent and Danny Welbeck put the visitors in the driving seat.
Stephen Hunt drew things level, though, and Ebanks-Blake netted at the death to hand Mick McCarthy's side three much-needed points.
Although they remain in the Barclays Premier League relegation zone, 19th-placed Wolves cut the gap between themselves and safety to three points and will take confidence from halting their recent four-match losing run in satisfying style.
Going into the game off the back of four successive defeats, Wanderers had also developed the nasty habit in their last three games of conceding very early goals. They made a more composed start against Sunderland, though, and were the side to launch the first few attacks.
Ronald Zubar had a cross cleared by Nedum Onuoha after playing a one-two with Foley and the ball skidded away from Matt Jarvis and David Jones as they tried to work something on the edge of the area.
Kevin Doyle then sent a delivery into the six-yard box which was put behind for a corner, but the visitors almost caught Wanderers out soon after as Jordan Henderson fed in Bent, the striker only able to shoot straight at Wayne Hennessey.
Boudewijn Zenden made a better effort with a drive that went wide, but Sunderland were fortunate not to score an own goal when John Mensah connected with Stephen Ward's cross.
The hosts went close again moments later as Craig Gordon flapped at Jarvis' corner, but Richard Stearman was just unable to apply a finish with his head at the far post. Doyle rifled an attempt too high and Gordon tipped a looping ball from Ward over the bar under the attentions of Jones. Wolves then had the ball in the net as Stearman stabbed George Elokobi's shot over the line, but the effort was ruled out for offside.
The Black Cats almost took the lead around the half hour mark as Kieran Richardson crashed a free-kick against Hennessey's post.
Wolves were immediately back on the offensive, though, and after good work down the right by Jones and Jarvis, Doyle could not stretch enough to meet the latter's cross.
Jarvis had the last opportunity of the half, striking into Gordon's arms, before Richardson became the second Sunderland player to be shown a yellow card for a foul on Doyle, following Lee Cattermole into the book.
Wolves began the second half brightly and after Zubar had sent an attempt just the wrong side of the post, they snatched the lead in the 50th minute. Foley drifted an early ball across to Jarvis, who cut inside and fired an effort at Gordon. The Scotland goalkeeper could only parry the ball, and Foley was on hand to lash it into the corner.
It was no more than Wanderers deserved on the balance of play, but they had to be alert to ensure they did not let in a swift equaliser, Elokobi blocking a shot from Bent after Henderson's free-kick had caused a scramble in the box.
Cattermole then drilled wide before Sunderland boss Steve Bruce introduced Asamoah Gyan from the bench along with Steed Malbranque, Zenden and Henderson the men to make way.
Doyle was presented with a decent chance when Zubar's deflected shot fell to him, but the Irishman's header was tame and Gordon collected.
Jarvis was next to try to extend his side's advantage, but blazed over from a good position. The hosts were almost made to pay as a defensive lapse let in Welbeck, but the youngster fired wide.
Within moments of that warning, Sunderland were level as Bent latched onto Gyan's flick-on and coolly slotted the ball past Hennessey. The hosts looked stung and almost quickly conceded another, Bent just firing wide.
Hennessey then palmed Malbranque's long-range effort away, but Sunderland had real momentum and with just under 15 minutes to go they went ahead, Welbeck heading in Phil Bardsley's cross for his fourth goal in three games.
It seemed as if Wolves had capitulated completely, but to their credit, they pulled themselves back level within four minutes, Elokobi getting a powerful header to Jarvis' cross and Hunt, who had come on for Jones, bundling the ball in.
Suddenly the impetus was with the hosts again and with a minute of the 90 left on the clock, they found a winning goal. It was another substitute, Ebanks-Blake, who provided it, the former Manchester United striker blasting in.
Wolves boss Mick McCarthy insists he would never criticise the club's supporters and claims it was news to him if his job was under threat before the victory over Sunderland.
Ahead of the clash at Molineux reports had quoted McCarthy - whose side are 19th in the Premier League - as describing people who used internet message boards and radio phone-ins as "numpties''.
After the match, though, the manager stressed that he had not been referring to Wanderers fans, who he was keen to praise for getting behind the team as they bounced back from 2-1 down to triumph 3-2 in a thrilling encounter.
"I haven't seen the newspapers, but somebody rang me this morning and said an article said that I'd had a go at the fans,'' McCarthy said. "I would never have a go at the fans.
"I have had such great support from everybody at the club, so I said I never take any notice of internet bloggers, radio phone-ins, or anything else. I said I think anybody who writes on one or rings in to one are numpties.
"What I do like are all those out there (the fans at Molineux), who have been brilliant. They have stuck with us and they stuck with us today. At 2-1 it would have been so easy to turn on the team, but they didn't and I think they didn't because the players have showed such good application and spirit.
"If you come down and see us at the training ground, that is not a team that is dispirited or disheartened at all. So if my future was in any doubt, it was news to me.''
Although Saturday's result did not change Wolves' lowly position in the table, McCarthy's team cut the gap between themselves and safety to three points and will take confidence from halting their recent four-match losing run in satisfying style.
When asked about his substitutions, which resulted in both replacements Stephern Hunt and Sylvan Ebanks-Blake scoring, McCarthy joked: "I must be a great manager. If I hadn't made them, then I'd be the numpty!''
Wolves thought they had gone ahead in the first period, but Richard Stearman's close-range finish was ruled out for offside - a decision McCarthy, who had been enraged at the time, later accepted was correct.
"I've looked at it again and it is offside - he is behind the goalkeeper and I think it's one of those where if you go for it you might get it, but in the end it was a good decision,'' McCarthy said.
"I wasn't saying that to the linesman at the time though. I guess I can afford to be gracious in victory towards the linesman.''
McCarthy's opposite number Steve Bruce lamented Sunderland's defensive display, branding the concession of three goals against the midlands outfit a "sacrilege''.
The Wearsiders were without injured central defensive duo Michael Turner and Titus Bramble and Bruce feels his side - who have gone unbeaten in this campaign against all of the teams that finished in last season's top 10 - must improve at the back if they are to avoid a similar mid-term slump to that which they suffered in 2009-10.
"To be fair, the goals kicked us into life and every time we went forward we looked as if we were going to score for a while there,'' Bruce said. "But if we defend like that, then it is going to be a tough winter for us again because defensively, individual mistakes have cost us the game.
"Obviously we were without Turner and Bramble and it showed today. We haven't been beaten against the top 10 teams which is a fantastic achievement. However, we have got to treat these ones with the same respect.
"We have defended rock solidly (in previous games), not just as individuals but as a team. The back four were busy today and were nowhere near the requirement needed. You can't come here and concede three goals - it's sacrilege, and that's no disrespect to Wolves.''