Paul Underwood bagged the winner after Posh skipper Curtis Woodhouse had levelled Rowan Vine's first-half opener.
The table-topping Hatters remained unchanged for the third game in a row with the only change from the Stockport squad being Stephen O'Leary coming in for Michael Leary on the bench.
Steve Robinson threatened first for Town when his curling 20-yard free-kick in the ninth minute dipped just too late and went over the bar.
Six minutes later Luton's Slovenian goalkeeper Dino Seremet made his full-home debut, replacing the injured Marlon Beresford.
Sol Davis fired a 20-yard effort over the top in the 19th minute before Danny Sonner hit a low shot past the post five minutes later for Peterborough's first attempt on goal.
Hatters took the lead in the 31st minute when Ahmet Brkovic spectacularly crossed from the left with an overhead kick and Vine netted from eight yards for his fourth of the season and third goal in three games.
Two minutes later another Brkovic cross, this time from the right, saw Steve Howard volley over on the stretch from six yards.
Hatters had looked comfortable enough in the first 45 minutes, but they were shocked by a Posh equaliser just two minutes after the break.
Steve Jenkins crossed from the right and visiting skipper Woodhouse stole in unmarked to volley into the corner from 10 yards.
Luton rallied and captain Kevin Nicholls saw a scorching 18-yard drive palmed past the post in the 54th minute before the hosts regained the lead three minutes later.
Robinson fed Vine running into the penalty area and the front man squared for Underwood to find the net off Sonner.
Vine went close in the 67th minute before being replaced by Gary McSheffrey, who almost made the perfect entrance when he cut inside Craig Ireland but saw his right foot shot bounce away off the underside of the bar in the 75th minute.