So cruel on the Millers ... on-the-whistle report: Rotherham United 1 Leicester City 2
But the Foxes, having arrived in South Yorkshire with a 100 per cent record, conjured up a winner with six minutes of regulation time remaining.
It was harsh on 21st-placed Rotherham who gave their best performance of the season despite being robbed of six potential first-teamers by injury.
They thought they had gone in front in the ninth minute when Jordan Hugill looked to have helped in Cameron Humphreys' goalbound header from Cafu's inswinging corner.
The celebrations at New York were in full flow when the referee was called over by his assistant and the effort was ruled out, possibly for a Dexter Lembikisa push on goalkeeper Mads Hermansen.
Salt was rubbed in Millers wounds three minutes later when the visitors took the lead, Kasey McAteer rising at the back post to nod in Kelechi Iheanacho's cross.
Cafu powered a header just over as the home side refused to wilt against quality opposition.
Referee Simon Hooper, stood down from the Premier League for his performance in Manchester United's win over Wolverhampton Wanderers, was in the firing line of home supporters as a serious of decisions went against Matt Taylor's men.
Ollie Rathbone combined beautifully with Cafu to burst down the right and Hermansen had to be at full stretch to palm away a cross made more dangerous by a looping deflection.
Rotherham were playing well and their breaks down the right flank, with Rathbone repeatedly to the fore, were causing Leicester problems.
Home shouts for a 34th-minute penalty went unheeded as Jannik Vestergaard clattered into Fred Onyedinma as the winger shaped to shoot while at the other end Viktor Johansson, playing against his former club, held on to Ricardo Pereira's piledriver.
On the stroke of half-time, Leicester broke quickly, Stephy Madvididi came off second best to Johansson who made a crucial save and the Millers headed in for the break still right in the contest.
Seven minutes after the restart, Andre Green headed wide at the back post from Cafu's corner when he should have hit the target but Rotherham had to wait only a matter of seconds before the equaliser came.
Green atoned with a superb cross from the left and Onyedinma glanced a lovely header into the corner of the net in front of a delirious North Stand.
Rotherham had brought the attacker straight back from a one-match and he responded with his second goal in his last two outings.
It was no less than the Millers merited and they continued to take the game to the high-flying visitors.
New signing Arvin Appiah came on for his debut, with Green departing to a standing ovation and still Rotherham pushed into enemy territory at every opportunity.
Tyler Blackett's block kept substitute Jamie Vardy at bay as the clock ticked down but the home team cruelly found themselves behind with six minutes remaining.
McAteer looked to have taken too long on the ball but he stepped inside and fired a pinpoint shot beyond Johansson.
Sub Tom Eaves saw a header blocked as the Millers tried to come again.
It was in vain and they went down to a defeat they didn't deserve.
Rotherham (4-3-3): Viktor Johansson; Dexter Lembikisa, Cameron Humphreys, Tyler Blackett, Cohen Bramall; Cafu, Christ Tiehi (Josh Kayode 81), Ollie Rathbone (Ciaran McGuckin 87); Fred Onyedinma, Jordan Hugill (Tom Eaves 72), Andre Green (Arvin Appiah 72). Subs not used: Dillon Phillips, Sean Morrison, Jamie McCart, Hamish Douglas, Tolaji Bola.
Leicester (4-3-3): Mads Hermansen; Ricardo Pereira, Wout Faes, Jannik Vestergaard, Callum Doyle; Wilfred Ndidi (Cesare Casedei 68), Harry Winks, Kiernan Dewsbury-Hall (Hamza Choudhury 87); Kasey McAteer (James Austin 87), Kelechi Iheanacho (Jamie Vardy 59), Stephy Mavididi. Subs not used: Danny Ward, Jakub Stolarczyk, Marc Albrighton, Timothy Castagne, Luke Thomas.
Goals: McAteer 12, 84 (Leicester); Onyedinma 53 (Rotherham).
Referee: Simon Hooper (Wiltshire).
Attendance: 11,418 (2,226).