Substitute Freddie Ladapo's last-gasp winner earned 10-man Rotherham a dramatic 2-1 win at fellow strugglers Sheffield Wednesday, ruining Darren Moore's first game in charge.
Ladapo's late strike also earned the Millers their first-ever league double over their South Yorkshire rivals in a fixture first contested in 1920.
Striker Michael Smith headed the visitors into a first-half lead, only to be red carded midway through the second period for violent conduct.
New Owls boss Moore then looked to have secured a point in his first game since leaving Doncaster when Matt Olosunde put through his own goal, only for Ladapo to strike in the seventh minute of stoppage time.
The win took Rotherham to within three points of safety, with Wednesday seven behind fourth-bottom Birmingham.
The Owls had started the game in threatening fashion from a couple of early Barry Bannan corners with Millers keeper Viktor Johansson reacting smartly to keep out a near-post Sam Hutchinson header and Callum Paterson missing the target after rising highest to meet the second flag-kick.
But Paul Warne's men proved more ruthless from their first chance of the night in the 17th minute.
Ending the Millers' barren spell of six-and-three-quarter hours without a goal, Smith met Florian Jozefzoon's right-wing delivery with a downward header from eight yards that bounced inside Joe Wildsmith's far corner.
In response, Liam Shaw evaded three challenges to tee up an edge-of-the-box opportunity for Bannan that he lofted well over.
A brilliant diagonal pass by Shaw sent Paterson clear through the right channel but he blasted wastefully wide of the near post.
Rotherham could have extended their lead before the break, however, as Lewis Wing rattled an upright from 15 yards with an angled drive and Wildsmith was also required to parry a Ryan Giles attempt to safety.
At the start of the second period, Paterson's 25-yard strike drifted wide of Johansson's goal while Adam Reach fired over from inside the penalty area after Josh Windass had exchanged passes with Bannan down the left.
Windass then skied over after Reach had returned the favour before Smith received his marching orders, shoving his head into Julian Borner's chest in a petulant reaction to been fouled by the defender.
Johansson reacted smartly to keep out a six-yard Paterson chance and Shaw was next to test the Millers keeper at his near post, before the Swede was eventually beaten in the most unfortunate of circumstances after 82 minutes.
Bravely racing out of his goal to smother a Matt Penney shot, he could only watch on in horror after the ball bounced off Olosunde and rolled into an unguarded net.
Paterson then squandered another gilt-edged chance, aiming too high with a free header seven yards from goal, before brilliant persistent play down the right by Matt Crooks and a crossfield pass released Ladapo, who curled an excellent 15-yard effort beyond Wildsmith.
His strike condemned the Owls to a fifth straight defeat - their worst sequence since December 2012.
What the managers said...
Sheffield Wednesday's Darren Moore: "The defeat is tough to take because I saw a performance from the lads that suggested the results won't be too far away and I don't want them to be too downhearted because they got on the front foot and that's how I want us to play. We did not get the right contact from our corner that led to their winning goal and they've broken away on us and it's ended up in our net, which happens in football.
"But we have got 13 games to go and plenty of points to play for. We know nobody will give us anything, but we're still in the mix and we've just got to keep working as hard as we did in this game and believing because I think, if we create as many good chances as we did against Rotherham, we will take more than we miss."
Rotherham's Paul Warne: "Our belief has never dwindled and, in the previous five games, we've been pretty good. We've had 50 attempts at goal, but only scored once and we just needed to be more clinical. In this game, we have scored two goals from opportunities that were harder than all those chances we haven't been taking and Freddie's showed real bravery and ability. When he hit it, I thought that's got a chance and I've never seen my assistant (Richie Barker) so happy.
"He was never that happy when he scored himself so, for him to behave like that, tells you what a good goal it was. I've been told we've never done the double over Sheffield Wednesday, so it's a night we'll always remember being a part of and it's given us a real feelgood factor.
"We're building a positive feeling now because we've got six first-teamers coming back by the end of the month so, hopefully, we can give it a good go in the last few weeks of the season."