Cummins claimed 4-12 in eight overs in his devastating spell and Mitchell Marsh and Mitchell Starc pitched in to remove Vernon Philander and Keshav Maharaj.
Opener Dean Elgar was 121 not out -- having been dropped on 53 and 87 --but South Africa's momentum had been completely removed by Cummins after the home team made a strong start to the crucial third test.
Australia was on top after struggling through the first two sessions. The four-match series is level at 1-1, and South Africa initially had a significant advantage after winning the toss and opting to bat on a good pitch in Cape Town.
Despite the early loss of Aiden Markram for a duck, Hashim Amla (33) and Elgar put on 86 and Elgar and de Villiers then constructed their big century partnership that threatened to take the game away from Australia.
Cummins didn't let that happen with his brilliant burst, starting when de Villiers scooped a catch straight to David Warner at mid-off. Du Plessis, Bavuma and de Kock all followed quickly.
As expected, South Africa selected Kagiso Rabada in its team for the crucial third test after the fast bowler had a two-match ban overturned on appeal this week, clearing him to play at Newlands. He was six not out alongside Elgar at stumps.
Australia won the opening test convincingly in Durban and South Africa replied with victory in Port Elizabeth, leaving what's been a fiercely-contested and often contentious series level with two tests to play.
While Rabada's successful appeal against an International Cricket Council ruling meant he was retained in the team, South Africa made two other changes. Batsman Bavuma was recalled after recovering from injury and fast bowler Morne Morkel also returned to the lineup.
Australia, which hasn't lost a test series in South Africa since the end of apartheid, kept the same team that played the first two tests.
(This story has not been edited by Business Standard staff and is auto-generated from a syndicated feed.)