Duminy suffered an Achilles tendon injury on Friday which has forced him out of the ongoing first Test in Brisbane and also out of the series and the left-hander will have surgery which will keep him out for nearly six months.
The 25-year-old Elgar is a left-handed batsman, who also bowls spin. He has played five One Day Internationals for South Africa.
"We have opted for a like-for-like replacement," CSA selection convener Andrew Hudson was quoted on CSA website.
"Dean can bat anywhere in the top order and he also gives us a back-up spin bowling option. He is currently in good form and made 76 with a strike rate of 107 in the Chevrolet Knights' only 50 overs game to date. He had a good debut for the Proteas in their recent ODI series in England and he fully deserves his call-up to our Test squad as well," Hudson added.