The 32-year-old produced a fifth-wicket stand worth 147 with James Taylor before the debutant was dismissed shortly after the tea break, and Pietersen was joined by Matt Prior for the final overs of the day as the hosts avoided the follow-on and now trail the tourists by 68 runs.
The hosts had resumed on 48-0, with Andrew Strauss and Alastair Cook looking to make inroads into the Proteas’ total of 419.
Despite wayward bowling ensuring that England made a comfortable start, South Africa responded and took their first wicket with the score reaching 65 – Vernon Philander’s delivery caught Cook plumb in line with the middle stump.
The Essex batsman tried to cling on with a hopeful review but the video replays only confirmed the worst, as he departed for 24.
A rain delay forced an early lunch, and Strauss and Jonathan Trott knew that they would face an uphill task to take anything from this must-win encounter.
The skipper was next to be dismissed – for 37 – as a cracking delivery from Dale Steyn found an outside edge and went through to the grateful gloves of AB De Villers behind the stumps.
With the pressure being piled on by the visitors, Trott and Pietersen looked to build a solid partnership to move the innings in the right direction.
Their resistance was brief as Steyn once again made an important breakthrough for Graeme Smith’s side.
An indecisive stroke would cost Trott his wicket for 35, as the Warwickshire man nicked through to Smith at first slip.
As the tea break got closer, Andy Flower would have been desperate for his troops to reach the interval without any further losses.
But his wish was not granted, as a wide, swinging delivery from Jacques Kallis tempted Ian Bell into an unnecessary driving stroke, which ended with Smith grasping another easy catch.
England were 183-4 at Tea, still 37 shy of the follow-in target, and the South Africans found themselves in the ascendancy.
The next home batsman being thrown in the lion’s den was debutant James Taylor, who came into the match on the back of an unbeaten 163 in a first-class game against Sussex.
The hopes of the home fans now rested on the confident figure of Surrey’s Pietersen, and he reached a 28th test half-century, with a pull shot off Steyn’s bowling.
He continued to look in imperious form with the bat, with the runs flowing nicely as Matt Prior joined him at the crease, and the 32-year-old comfortably steered the hosts beyond the follow-on mark and reduce the deficit to 68 runs.
MORE: The latest football news
MORE: The latest tennis news
BIOGRAPHY: Daniel Sturridge
BIOGRAPHY: Kepa Arrizabalaga