The upshot is that SA have to win in Manchester if they are not to suffer their first series defeat in the four rubbers they have played here since 1998.
Morne Morkel was 18 not out after Kagiso Rabada (23) was brilliantly caught by a diving Ben Stokes in the gully off Stuart Broad in what became the last ball of the day.
That left time for just four overs before lunch - and Anderson did not miss his cue with the nearly instant dismissal of Elgar, a centurion at The Oval only five days ago. It was an innings that displayed a total mastery of the craft of Test match batting which the Essex opener has honed over an 11-year worldwide career.
England ended day one on 260/6 and will continue batting on Saturday at 11:00 local time or 10:00 GMT.
The first day of Test cricket in the north of England this summer produced enough to hold the attention of a near capacity but notoriously tough- to-please crowd. In terms of impact, De Kock has been as good as Hashim Amla or AB De Villiers.
But it was not until both batsmen had counted an opening boundary that Roland-Jones instantly paid the price for aiming another, instead poking a mistimed drive on the up straight into the hands of point off Rabada.
Bavuma might have been run out on 23, but Moeen failed in his attempt to take the stumps, while two hard chances were dropped in successive balls.
Olivier and Rabada picked up two wickets apiece, while Morkel and Maharaj claimed one wicket each.
Anderson's fourth wicket came when Theunis de Bruyn edged to Joe Root at second slip.
Ali followed up with his 20th wicket of the series, surpassing his previous best of 19 at home to India in 2014, when Keshav Maharaj was plumb lbw.
Bairstow was 33 not out, having survived a contentious umpire review for a slip catch after initially being given out for just four.
After battling through illness in the third Test at The Oval, Vernon Philander succumbed to a back spasm on the eve of the match, as did another valued member of their fast-bowling stocks, Chris Morris - whose pace and aggression had been instrumental in their second-Test fightback at Trent Bridge last month.
A brilliant dismissal though it was, de Kock had arguably made up in athleticism and hang-time what he had lacked in his initial footwork, as he dived fully to his right to gather the flying edge.
While England might go unchanged for this test match, the Proteas might make a few changes.
Bairstow's was the 17th innings of 99 by an English player in Test cricket, but a lot of finger's will be pointed at Du Plessis for setting his field back when he did. Bavuma and Faf du Plessis suggested another revival with a 47-run stand for the fourth wicket, but Anderson's spell threw the match firmly into England's favour.