The Black Cats controlled the first half on Sunday and almost went ahead when James McClean rattled the bar with a fierce drive in the first half, but they soon took the lead after the break through Sebastian Larsson's free-kick.
McClean, 22, got the goal he deserved just before the hour when he glanced home Larsson's cross to make it five wins from seven matches since O'Neill took charge.
The turnaround in fortunes since the northern Irishman took over has been remarkable.
Steve Bruce's reign ended with Sunderland looking serious contenders for the drop, but O'Neill has given the Black Cats a new-found confidence and organisational steel that was badly missing under the former Manchester United defender.
They will face harder tests in the coming months, but the way in which Sunderland easily avoided a potential banana skin here was highly impressive.
Aware of high-flying Peterborough's potential to cause an upset, O'Neill made just two changes to his team, with Phil Bardsley and Larsson coming in to a team that lined up in a 4-5-1 formation with Stephane Sessegnon as the Black Cats' lone striker.
The Posh went in to the game on the back of a five-match unbeaten run that has put them within striking distance of the playoffs and they started confidently, with Paul Taylor striding forward before blazing over Simon Mignolet's bar.
It did not take Sunderland long to get in to their stride, however. Bardsley opened up the Peterborough defence with a clever slide-rule pass but Larsson shot wide and Craig Gardner then stung Joe Lewis' palms with a powerful drive after George Boyd dallied on the ball in midfield.
Ryan Bennett then had to clear over his own bar from eight yards after Gardner whipped in a dangerous low cross.
Peterborough started to play with more confidence and Tommy Rowe fired a dipping volley just wide in the 13th minute, but they soon found themselves on the back foot again.
The home fans gasped as Lewis dropped Kieran Richardson's cross, but the Posh defence came to his rescue and cleared.
Taylor then raced forward 30 yards before flashing a 25-yard drive just past Simon Mignolet's goal in the hosts' best opportunity of the half.
Youngster McClean cut in off the flank after picking up Bardsley's cross and blasted a fierce drive that rattled Mignolet's bar to sound Peterborough a warning as the end of the first half neared.
Gabriel Zakuani and Ryan Bennett needed treatment after clashing heads and Sunderland took advantage of their numerical superiority while defender Bennett was off the pitch.
Gardner got on the end of Larsson's dangerous cross with a powerful header that Lewis spilled but the ball was hooked clear before the away side could tap in.
Bennett returned to the pitch sporting a bandage around his head soon after.
Bardsley fired a low shot which Lewis easily saved in first-half injury time as Peterborough ended the first half firmly on the back foot.
Craig Alcock's foul on McClean gave Sunderland a free-kick five yards from the right corner of the Peterborough box three minutes in to the second half and the away side took full advantage.
Larsson whipped in a curling ball from the free-kick that evaded the sea of players from both sides in the box and sneaked to the net at the back the post to give the away side the lead.
The Swede came close to adding his second with a low drive that Lewis parried moments later.
Posh boss Darren Ferguson brought on Daniel Kearns for Scott Wootton as he looked to get his team back in to the game quickly.
McClean dashed their hopes moments later, however, when he rose to glance home Larsson's cross at the near post from eight yards to double the Black Cats' lead.
McClean raced at the Peterborough defence after dispossessing Lee Tomlin on the halfway line but Bennett kept his cool and put a firm tackle to steal the ball off the northern Irishman.
The young winger then fired a low ball across the box but no one could get a touch to make it 3-0.
Sunderland pushed for a third through Larsson but his late effort flew wide and the Black Cats had to settle for a two-goal victory margin.