Match ends, Wigan Athletic 1, Rotherham United 2.
Rotherham earned their first win in 10 matches to leave fellow strugglers Wigan six points from safety after just one win in 17 matches.
Tom Lawrence capitalised on Andrew Taylor's mistake to race through on goal and open the scoring for the visitors.
Ben Watson headed home a leveller for Wigan from James McClean's corner after the break.
But Alex Revell headed the winner just a minute later.
Wigan, one of the pre-season favourites for promotion, have not won at home in the Championship since the end of August and lie second-bottom.
They were denied a late leveller when Oriol Riera's header came back off the crossbar as new boss Malky Mackay suffered a fourth defeat in his five matches in charge.
The victory was Rotherham's first away win in the league since 23 August, and moves them up to 19th.
Wigan manager Malky Mackay:
"We're creating chances, we're just not being clinical enough in front of goal, and at the other end we're giving away not even soft goals.
"Physically we did match them, we worked hard enough, but we have to be clinical at one end and resilient at the other - and we've not been good enough at either end so far.
"The squad is too big, and we've got to make sure in January we do business properly. It's about us trying to build a team here, and my first responsibility is trying to improve the team."
Rotherham manager Steve Evans:
"I thought Wigan started better than us, and for 10 minutes they caused us problems. Once we sorted ourselves out we dominated for long spells.
"Credit to my players, they're very young in the main but we are giving them the freedom to express themselves.
"I said last week that Tom [Lawrence] is like a lighthouse in a dark ocean, and when he scores a goal and works as hard as that, you know he's a lighthouse in a dark ocean with a nice bottle of red wine waiting for you when you get there.
"He's a special talent and you need to get him on the ball. For every week we've got him we're grateful."
- 7McCannBooked at 47minsSubstituted forForshawat 80'minutes
- 19CowieSubstituted forRiera Magemat 63'minutes
- 10MaloneySubstituted forFortunéat 53'minutes
- 11McCleanBooked at 70mins
- 9Riera Magem
- 30WoottonBooked at 59mins
- 32LedesmaSubstituted forTaylorat 80'minutesBooked at 90mins
- 11GreenBooked at 35mins
- 34LawrenceBooked at 42minsSubstituted forBoweryat 71'minutes
- 9RevellSubstituted forFrecklingtonat 84'minutes
- Keith Stroud
- Shots on Target
Second Half ends, Wigan Athletic 1, Rotherham United 2.
Attempt blocked. Jordan Bowery (Rotherham United) right footed shot from outside the box is blocked. Assisted by Ben Pringle.
Paul Taylor (Rotherham United) is shown the yellow card.
Corner, Rotherham United. Conceded by James Perch.
Attempt blocked. Marc-Antoine Fortuné (Wigan Athletic) right footed shot from the centre of the box is blocked. Assisted by Ben Watson.
Oriol Riera (Wigan Athletic) hits the bar with a header from the centre of the box. Assisted by Callum McManaman with a cross.
Adam Forshaw (Wigan Athletic) wins a free kick in the defensive half.
Foul by Scott Wootton (Rotherham United).
Foul by Marc-Antoine Fortuné (Wigan Athletic).
Adam Collin (Rotherham United) wins a free kick in the defensive half.
Corner, Wigan Athletic. Conceded by Paul Taylor.
Substitution, Rotherham United. Lee Frecklington replaces Alex Revell because of an injury.
Offside, Wigan Athletic. Scott Carson tries a through ball, but Marc-Antoine Fortuné is caught offside.
Leon Barnett (Wigan Athletic) wins a free kick in the defensive half.
Foul by Alex Revell (Rotherham United).
Attempt missed. Marc-Antoine Fortuné (Wigan Athletic) left footed shot from the centre of the box is too high. Assisted by Oriol Riera.
Substitution, Rotherham United. Paul Taylor replaces Emmanuel Ledesma because of an injury.
Substitution, Wigan Athletic. Adam Forshaw replaces Chris McCann.
Attempt missed. Alex Revell (Rotherham United) right footed shot from the centre of the box is close, but misses to the left. Assisted by Jordan Bowery.