Match ends, Rotherham United 1, Sheffield Wednesday 2.
Second-half goals from Lucas Joao and Fernando Forestieri gave Sheffield Wednesday a derby victory at Rotherham.
Joao capitalised from a Tom Thorpe defensive error to put the Owls ahead straight after the break.
Forestieri doubled Wednesday's advantage minutes later when he tapped in after home keeper Lee Camp failed to grasp a Daniel Pudil header.
Rotherham's Thorpe slotted home from substitute Chris Maguire's cross in the final minute of stoppage time.
Joao scored his third goal for the club but the win came at a personal cost for the Portuguese striker after he lost a tooth when he was caught by Maguire's arm shortly before being substituted off in the 74th minute.
Victory for Carlos Carvalhal's Wednesday side stretches their unbeaten run to seven league matches and they remain ninth in the Championship ahead of their League Cup tie against Arsenal on Tuesday.
Owls midfielder Barry Bannan missed the best chance of the first half when he headed narrowly over after a quick break.
His side took the lead after the break. Former Manchester United man Thorpe was caught in possession on the edge of the area and Joao was left with an easy tap-in after Camp palmed Forestieri's low shot straight out to him.
Forestieri made it 2-0 in the 50th minute when he netted after Camp made a mess of Pudil's header from a corner.
The Millers pushed on to get back in the game, but it took until the final minute for them to get on the scoreboard, with Thorpe's second goal for the club.
They have now lost two of their three games under new boss Neil Redfearn, but are only one point adrift of safety.
Rotherham boss Neil Redfearn:
"I thought first half we did well enough, I thought we locked horns with them.
"We created one or two half-chances, as they did.
"We talked at half-time about coming out of the traps, which we did on Tuesday against Reading where we got an equaliser, got the crowd up and got on the front foot and tonight we did the opposite.
"If you look at both goals they are poor from our point of view."
Sheffield Wednesday head coach Carlos Carvalhal:
"It's amazing how in three months we have changed a lot of things, but we are still in the process.
"The players are doing fantastic, they follow our ideas, they have an amazing attitude, they are playing like a group.
"There are probably 10 or 12 teams better than us in this competition and we have to show on the pitch that we can fight with these teams and let's see what we can do.
"I still think we can do better."
- 11GreenSubstituted forBoweryat 62'minutes
- 24AndreuSubstituted forMaguireat 49'minutes
- 19Clarke-HarrisBooked at 51mins
- 27DerbyshireBooked at 81mins
- 32HuntBooked at 45mins
- 36PudilBooked at 89mins
- 4HutchinsonBooked at 76minsSubstituted forSemedoat 90+2'minutes
- 41BannanBooked at 69mins
- 45ForestieriSubstituted forBusat 90+3'minutes
- 18Lucas JoãoSubstituted forNuhiuat 74'minutes
- Mike Jones
- Shots on Target
Second Half ends, Rotherham United 1, Sheffield Wednesday 2.
Foul by Jonson Clarke-Harris (Rotherham United).
Jack Hunt (Sheffield Wednesday) wins a free kick in the defensive half.
Goal! Rotherham United 1, Sheffield Wednesday 2. Tom Thorpe (Rotherham United) right footed shot from very close range to the bottom right corner. Assisted by Chris Maguire with a cross following a set piece situation.
Harry Toffolo (Rotherham United) wins a free kick on the left wing.
Foul by Josè Semedo (Sheffield Wednesday).
Substitution, Sheffield Wednesday. Sergiu Bus replaces Fernando Forestieri.
Substitution, Sheffield Wednesday. Josè Semedo replaces Sam Hutchinson.
Attempt missed. Matt Derbyshire (Rotherham United) header from the centre of the box misses to the left. Assisted by Chris Maguire following a set piece situation.
Daniel Pudil (Sheffield Wednesday) is shown the yellow card for a bad foul.
Matt Derbyshire (Rotherham United) wins a free kick in the attacking half.
Foul by Daniel Pudil (Sheffield Wednesday).
Attempt missed. Barry Bannan (Sheffield Wednesday) left footed shot from the centre of the box misses to the left. Assisted by Ross Wallace.
Foul by Chris Maguire (Rotherham United).
Kieran Lee (Sheffield Wednesday) wins a free kick in the defensive half.
Matt Derbyshire (Rotherham United) is shown the yellow card for a bad foul.
Foul by Matt Derbyshire (Rotherham United).
Fernando Forestieri (Sheffield Wednesday) wins a free kick in the defensive half.
Attempt missed. Jordan Bowery (Rotherham United) right footed shot from the centre of the box is close, but misses to the right following a set piece situation.