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.