Faf du Plessis departed for 55 off 126 balls midway through the session, as spinner Nathan Lyon had the batsman caught at short leg as the 226 ball stand came to an end.
With the fall of the wicket, it brought AB de Villiers to the crease with South Africa on 123 for three.
At tea, both De Villiers (13 not out) and Elgar were unbeaten while Ryan Harris returned figures of 1/31 for Australia.
In the morning session, captain Graeme Smith and Hashim Amla were both out lbw, as South Africa fell to 11 for two. Smith was out to Harris, and Amla was removed by Mitchell Johnson.
Earlier, Smith was rushed at the toss as team management made late changes to the team. Smith won the toss and chose to bat.
South Africa made three changes to the side which lost to Australia in the first Test.
Quinton de Kock, Dean Elgar and Wayne Parnell came into the team for Alviro Petersen, Robin Peterson and Ryan McLaren.
The match would be the debut for De Kock, listed to bat at number seven.
South Africa trail Australia 1-0 in the three-match series.