South Africa had been cruising to a big first-innings total at 220 for two as Elgar and AB de Villiers put on 128 for the third wicket.
Yet the return of Cummins (4-64) to the attack saw the seamer take 4-12 in eight overs, starting with the wicket of De Villiers (64), to rip through the home side’s middle order.
South Africa lost six wickets for 37 runs as fortunes swung in favour of the visitors in the final session.
Elgar (121 not out) will resume his innings with Kagiso Rabada (6) on Friday, seeking to push South Africa past 300 in their first innings, which should be a minimum on a slow wicket that has bounce but not much in the way of lateral movement.
The tempestuous four-game series is poised at 1-1 with South Africa’s hopes of a decent first-innings total resting largely on the shoulders of Elgar, who was dropped on 54 off a simple chance for Nathan Lyon at point.
The home side won the toss and elected to bat, losing opener Aiden Markram early for a duck as he edged Josh Hazlewood (2-37) to a diving Steve Smith at second slip with the score on six.
Elgar and Hashim Amla (31) added a patient 86 for the second wicket before the latter attempted a hook off Hazlewood, but top-edged the stroke to Cummins at fine leg.
Elgar and De Villiers turned the tide in South Africa’s favour with some excellent stroke-play, but when De Villiers miss-timed a drive to David Warner at mid-off, it set off a collapse that has put Australia in pole position.
Home captain Faf du Plessis (5) and the recalled Temba Bavuma (1) were both caught by Smith off Cummins, before Quinton de Kock (3) got an under-edge to the Australian paceman and was caught by wicketkeeper Tim Paine.
Mitchell Marsh (1-26) accounted for Vernon Philander (8), also caught by Paine, while Keshav Maharaj (3) lofted a drive to Cameron Bancroft off the bowling of Mitchell Starc (1-81).
First Published: March 23, 2018, 7:50 AM IST