Van Zyl, batting at No 4, was unbeaten on 80 (120 balls, 12 fours), with opener Elgar having struck 56 (135 balls, 7 fours).
The reply started poorly for South Africa as captain Stephen Cook (5) and Omphile Ramela (4) both fell cheaply. Van Zyl and Elgar rebuilt well with a 114-run third-wicket stand, but the loss of the latter and Temba Bavuma (21) with what proved to be the final ball of the day was a late set-back.
Chris Tremain was the pick of the bowlers with 3/51.