Linda Motlhalo kept her cool to convert the kick in the fourth minute of the final added time.
The win pushed the Banyana Banyana into Saturday’s final match against either defending champions Nigeria or hosts Morocco.
Zambia were making their first appearance in the WAFCON semi-finals on their third outing at the tournament, but the manner of their exit will frustrate coach Bruce Mwape and his squad.
This was after a lengthy video assistant referee (VAR) review which ended with centre referee Lidya Tafesse pointing to the penalty kick spot.
This was for a coming together between South Africa forward Jermaine Seoposenwe and Zambia’s Martha Tembo.
There were no South African appeals when Seoposenwe went over in the 89th minute.
Replays showed Tembo had blocked an attempted pass before the momentum of Banyana Banyana forward Seoposenwe took her into the Zambia defender.
Three minutes later, after checking her pitch-side monitor, Ethiopian referee Tafesse deemed the challenge was worthy of a penalty kick.
Motlhalo went on to net her second goal of the tournament to put Desiree Ellis’ side through.
In a match of few clear chances in Casablanca, Zambia goalkeeper Catherine Musonda made a fine save to deny Hildah Magaia late on.
That was after Grace Chanda had shot narrowly wide at the other end.
Zambia, without captain Barbra Banda because of gender eligibility issues, had lost first-choice goalkeeper Hazel Nali after she failed a late fitness test.
Her replacement Musonda had little to do in the first half as Zambia had the better openings, with Lubandji Ochumba bundling wide early on.
Also, Siomara Mapepa failed to get on the end of an inviting ball from Chanda.
South Africa, themselves missing star forward Thembi Kgatlana through injury, offered little.
They thought they had a penalty kick on the hour mark when Noxolo Cesane went down under the challenge of Lushomo Mweemba.
However, a VAR review showed the foul took place outside the penalty box, and Seoposenwe fired her free kick over the bar.
South Africa will now face hosts Morocco after defeating defending Champions Nigeria while Zambia will play the falcons for a third-place playoff.