They were set for a point after Tony Andreu's first-half header had been cancelled out by Eoin Doyle until Jonson Clarke-Harris headed into his own net with the last meaningful attack of the game.
Here's five things we learned from the game.
Rotherham can't draw
We have been banging on about this for a while now, but Rotherham's inability to get draws is beginning to hurt. From 25 games this season they have drawn only three and only one in 15 under Neil Redfearn. If the Millers are relying on wins to keep their points tally ticking over then that spells danger and heaps the pressure on. Last year, wins were harder to come by, but the amount of draws the Millers registered saw a regular income of points. Redfearn has mentioned a 'if you can't win, don't get beat' mantra. Well, the Millers need to start delivering.Defeats like that happen to relegated sides
Their failure to hang on for a point and the manner of the winning goal is frankly the sort of thing that happens to sides that are relegated. We are not saying that the Millers are going to go down - they are out of the relegation zone after all - but the game at Preston was one they should have taken a point from. They had weathered the storm and may have been lucky to be still level but they got to the final attack on level terms. Any team can lose to a last-minute goal but with so much at stake the teams that thrive tend to see out games like that.Shay Facey looks promising
The Manchester City loanee was thrown straight into his senior debut at right-back just hours after his move was confirmed to become the 31st player to pull on the red and white shirt this season. He has been training with the Millers for the last few weeks, though, and settled in well, particularly impressing in the first half. Blessed with rapid pace, it allows him to recover well and get his team out of danger and he showed on several occasions that he has the defensive nous. He clearly has the legs to get up and down the pitch and could be an important player in the next few months.Preston v Rotherham: https://t.co/ymLcyxzsx6 via @YouTube
— Rotherham United (@OfficialRUFC) January 3, 2016