Playing their game in hand on Southend, Millwall climbed up to sixth as the striker won and scored a penalty during the second half.
Gregory had missed two late spot-kicks in Saturday's 0-0 draw at Oldham, effectively costing Millwall two points in their pursuit of promotion. His response not only secured the two further points he may have felt he owed Millwall, but came as victory began to look beyond their reach.
The hosts started with some promise, when in the opening minutes striker Harry Smith's shot was routinely saved by Luke McGee and then when Shaun Williams struck just over the crossbar.
It was then that Peterborough began to respond. Marcus Maddison tested Millwall goalkeeper Tom King with a 25-yard free-kick, and then the hosts prematurely began to tire.
Playing their eighth fixture in February, Neil Harris' team - who have not conceded a goal since January 21 - also looked short of inspiration until Gregory's show of determination.
The 28-year-old won possession in the 54th minute, broke down the left wing on the counter-attack, and carried the ball into the penalty area until being brought down by Anthony Grant.
A one-time strike partner of Jamie Vardy at Halifax, Gregory then showed admirable belief to again take responsibility, this time beating the diving McGee by finishing into the bottom left corner.
Millwall's defence remained resilient thereafter, securing the result that leaves Peterborough five points behind the top six.
Report supplied by the Press Association.
Match ends, Millwall 1, Peterborough United 0.
Second Half ends, Millwall 1, Peterborough United 0.
Shaun Williams (Millwall) wins a free kick in the attacking half.
Foul by Ryan Tafazolli (Peterborough United).
Bradden Inman (Peterborough United) is shown the yellow card for a bad foul.
Fred Onyedinma (Millwall) wins a free kick in the attacking half.
Foul by Bradden Inman (Peterborough United).
Substitution, Millwall. Shaun Hutchinson replaces Ben Thompson.
Corner,  Peterborough United. Conceded by Tony Craig.
Shaun Cummings (Millwall) wins a free kick in the attacking half.
Foul by Michael Bostwick (Peterborough United).
Marcus Maddison (Peterborough United) is shown the yellow card for a bad foul.
Shaun Williams (Millwall) wins a free kick in the attacking half.
Foul by Marcus Maddison (Peterborough United).
Ben Thompson (Millwall) wins a free kick on the right wing.
Foul by Marcus Maddison (Peterborough United).
Substitution, Millwall. Callum Butcher replaces Lee Gregory.
Substitution, Peterborough United. Lee Angol replaces Michael Smith.
Attempt missed. Craig Mackail-Smith (Peterborough United) right footed shot from the centre of the box misses to the left.
Attempt blocked. Marcus Maddison (Peterborough United) left footed shot from outside the box is blocked.
Corner,  Millwall. Conceded by Michael Smith.
Attempt saved. Jake Cooper (Millwall) header from a difficult angle on the left is saved in the top left corner.
Corner,  Millwall. Conceded by Ryan Tafazolli.
Attempt blocked. Chris Forrester (Peterborough United) left footed shot from outside the box is blocked.
Attempt saved. Ben Thompson (Millwall) left footed shot from outside the box is saved in the centre of the goal.
Tony Craig (Millwall) wins a free kick on the left wing.
Foul by Marcus Maddison (Peterborough United).
Attempt saved. Craig Mackail-Smith (Peterborough United) right footed shot from outside the box is saved in the centre of the goal.
Corner,  Millwall. Conceded by Andrew Hughes.
Corner,  Millwall. Conceded by Luke McGee.
Corner,  Peterborough United. Conceded by Shaun Cummings.
Substitution, Peterborough United. Chris Forrester replaces Anthony Grant.
Shane Ferguson (Millwall) is shown the yellow card for a bad foul.
Foul by Shane Ferguson (Millwall).
Bradden Inman (Peterborough United) wins a free kick in the defensive half.
Attempt missed. Lee Gregory (Millwall) header from the centre of the box is high and wide to the right.
Attempt saved. Aiden O'Brien (Millwall) right footed shot from outside the box is saved in the bottom left corner.
Jake Cooper (Millwall) wins a free kick in the attacking half.
Foul by Bradden Inman (Peterborough United).
Substitution, Peterborough United. Craig Mackail-Smith replaces Leonardo Da Silva Lopes.
Millwall returned to the League One play-off places with a home win over Peterborough after Lee Gregory redeemed himself from the penalty spot.