Second-half goals from Nkosingiphile Ngcobo and Luvuyo Mkatshana saw South Africa finish top of Group B and ensure their passage to the semi-finals.
Egypt opened the scoring in the 18th minute through Mohamed Karem, who profited from a poor headed clearance that ricocheted into the penalty area.
Thabani Zuke hit a beautiful effort from range that forced Egyptian shot-stopper Mohamed Daader to pull off an acrobatic save to deny Amajita the equaliser in the 36th minute.
Amajita skipper Thendo Mukumela picked up a booking for an off-the-ball incident in which he punched an Egyptian defender as he waited for a corner-kick to be taken, and was lucky to remain on the park.
However, the booking was Mukumela’s second of the competition and he is thus set to miss their semi-final clash on Thursday.
Egypt were almost two goals to the good just before half-time, when Amajita goalkeeper Khulekani Kubheka misjudged the flight of the ball as it leaped over his outstretched hand and onto the crossbar.
Fifteen minutes into the second half, Thabo Senong’s side levelled matters through Ngcobo’s low drive from range, as Daader was sent the wrong way.
South Africa then took the lead in the 71st minute as Mkatshane was played in by Lyle Foster, before neatly striking the ball beyond the reach of Daader.
Amajita were placed under tremendous pressure in the final 10 minutes as Egypt committed numbers in attack.
The Pharaohs almost equalised late on but for a fine block from Zuke, who cleared off the line to protect the slender lead.
Amajita will now wait to find out who they face out of the best runners-up from all the three groups in the first semi-final on Thursday at 13h00 (SA time).
Amajita XI: Kubheka, Mabiliso, Sambo, Mukumela (c), Cupido, Zuke, Matlou, Ngcobo, Mashiane (Sibiya 46'), Mkatshana, Foster.