The Proteas reached stumps on 140-4 after Australia had taken a 100-run first-innings advantage, having been dismissed for 329 before the visitors responded with 429. With the three-match series tied at 1-1, the final two days promise an intriguing finish.
Josh Inglis was Australia's outstanding performer, scoring 102 from 135 balls to register his second Test century. He received excellent support from wicketkeeper Alex Carey, who made 80, while Matt Renshaw contributed 74 and Cameron Green scored 65.
Simon Harmer led South Africa's bowling attack, taking four wickets for 104 runs. Marco Jansen also impressed with three wickets for 60, including the dismissals of Renshaw and Green, as the hosts worked hard to limit Australia's advantage.
South Africa's second innings began badly, with Aiden Markram dismissed for one and David Bedingham falling for 11. The early setbacks left the hosts under pressure as Australia's bowlers looked to exploit the conditions at Newlands.
Marques Ackerman once again showed his value with a determined 62 from 80 balls. Having scored 95 in South Africa's first innings, he continued his impressive performance with another important contribution under pressure.
Ackerman shared a 64-run partnership with captain Temba Bavuma, who scored 35 before Nathan Lyon bowled him late in the day. Mitchell Starc also made a crucial breakthrough by dismissing Ackerman, finishing the day with two wickets.
Matthew Breetzke and Ryan Rickelton were unbeaten at the close, giving South Africa hope of building a more substantial lead on day four. Their partnership will be important if the hosts are to put Australia under pressure in the final innings.
South Africa have work to do, but Ackerman's fighting knock has kept the match alive. Australia will look to strike early on day four, while the Proteas will aim to extend their 40-run advantage and set up a challenging finish to the series.