The tourists went into bat knowing that they need 382 runs in order to complete the series with an overall 3-0 victory, but hopes have dwindled as they reached stumps on 52-3.
James Anderson was the man to cause the damage, and Ben Stokes later got involved in the action as he dismissed Jean-Paul Duminy for 29 and Stuart Broad ousted Amla, with the batsman four runs shy of a century.
After South Africa declared, England went in to bat, but it was a poor start as Hales, whose batting average of the series is just 17 runs, was trapped lbw by Kagiso Rabada for one run.
The tourists had just eight runs on the board when Cook was caught and bowled by Morne Morkel for five off 26 balls. The misery continued when Compton fell for just six runs off Rabada's delivery.
Joe Root was given a lifeline when Quinton de Kock fluffed his chance of getting a run-out, and the England batsman survived another scare when South Africa's review of an lbw shout from Dane Piedt went the tourists' way.
The 25-year-old and batting partner James Taylor will return to the crease on day five unbeaten on 19 runs each.
England need 330 runs to win.