Lee Tomlin stuck early with James Henry equalising for the home side before Tommy Rowe and Nathaniel Mendez-Laing scored either side of a second goal from Tomlin and George Boyd capped a wonderful display by adding a fifth late on.
The visitors took the lead in the seventh minute as Boyd controlled the ball in the penalty area before cutting it back into the path of Tomlin, who rifled past David Forde for his ninth goal of the season.
Millwall reacted well to falling behind and almost levelled four minutes later as Liam Trotter found Henry, whose cross just evaded the on-rushing Rob Hulse.
The equaliser soon followed as Lowry released Henry who lofted a beautiful chip over Robert Olejnik for his third goal in as many games.
Boyd then showed a mixture of determination and skill to beat Millwall right-back Adam Smith, showing good awareness as he rolled the ball into the feet of captain Rowe who arrowed Posh back in front.
Darren Ferguson's half-time team-talk was nearly made easier with 40 minutes gone as Tomlin's flick released Dwight Gayle whose near-post effort had Forde sprawling to save.
Millwall boss Kenny Jackett made two changes at the break with Martyn Woolford and Alan Dunne replacing Benik Afobe and Smith.
But it was Boyd, looking to turn from provider to scorer, who struck a 51st-minute effort that flashed wide of Forde's left-hand post. The game settled into a rhythm with neither side forcing the issue until an error by Millwall defender Karleigh Osbourne let Posh in for their third goal.
Osbourne played a pass across his defensive line that was too short and Peterborough reacted quickly with Kane Ferdinand robbing Jimmy Abdou of possession and Tomlin was again on hand to finish another perfectly-weighted Boyd pass.
The Posh fans were soon cheering another goal as Mendez-Laing drifted past two Millwall defenders with ease before unleashing a fierce effort that gave Forde no chance.
Osbourne then forced the Austrian goalkeeper into a reaction save as the hosts looked to give themselves hope of achieving an unlikely result. But, Shane Lowry was shown a straight red card by referee Darren Bond for hauling down Gayle when he was clean through on goal.
Howls of derision rang around the remaining Millwall fans inside the stadium with Boyd grabbing a well-deserved goal to make it 5-1 and to leave Jackett's cup heroes languishing in 14th place in the Championship table.