Cook and Joe Root (31 not out) added 60 for the third wicket as England, who have won the series, look to get close to the hosts’ first-innings total of 475 on a pitch starting to show variable bounce.
Cook is 50 short of becoming the first England batsman to reach 10,000 test runs.
The touring side had lost opener Alex Hales (15) cheaply before tea when he guided a wide delivery from Kagiso Rabada to Dane Piedt at point for another soft dismissal.
Nick Compton (19) became Rabada’s second victim when he fell lbw to a delivery that never got more than a foot off the ground from good length, a sign of the wear in the pitch.
South Africa wicket-keeper Quinton de Kock earlier reached his maiden test century with a fluent unbeaten 129 from 128 balls before running out of partners as the home side posted a sizeable total.
De Kock smashed 17 fours and two sixes in a showcase of his rich potential that was a mixture of finesse and a brutal attack on the bowling. After picking up the wickets of Temba Bavuma (35) and Rabada (0) early in the morning session, England may have expected to run through the South African tail.
But a stand of 50 for the eighth wicket between De Kock and Kyle Abbott (16), and 82 for the ninth with Piedt (19), kept the touring side in the field until 40 minutes before tea.
Frustration for the tourists was exacerbated by dropped catches, including two off De Kock.
De Kock’s century followed tons on the first day for Hashim Amla and debutant Stephen Cook, offering South Africa hope of a first test win in more than 12 months.
England all-rounder Ben Stokes continued his fine tour with bat and ball as he finished the South African innings with figures of 4-86.
(Editing by Ed Osmond)