South Africa were 411 for one at lunch, after adding 113 runs in 27 overs during the morning.
Amla reached his 27th Test century and was unbeaten on 137, while Elgar was on a Test career-best 172 not out.
Amla joined former captain Graeme Smith as the country's second-highest century-maker, behind only Jacques Kallis, who made 45.
The second wicket partnership between Elgar and Amla was worth 215.
The only wicket to have fallen in the match was that of new cap Aiden Markram, who was run out for 97 on Thursday.
Disclaimer: No Business Standard Journalist was involved in creation of this content