The South Africans took a first-half lead through Ace Bhengu, but were reduced to 10 men on 52 minutes when the careless Thamsanqa Sangweni received a second yellow card.
Under-23 goalkeeper Brilliant Khuzwayo saved a penalty from Jean-Michel Seri, but the Ivorians then equalized with eight minutes remaining through Henri Griffiths.
A sparse crowd turned up to watch the match and saw South Africa take the lead as Rodney Ramagalela produced a pinpoint cross for Bhengu to head home from close-range on 22 minutes.
South Africa had looked completely comfortable up to halftime, but the game changed seven minutes after the break when Sangweni deservedly received his marching orders. He had been testing the patience of the referee and indeed might have been off sooner, but eventually committed one foul too many.
The Ivorians should have leveled on 66 minutes when Erick Mathoho brought down Vamouti Diomande in the area, but Khuzwayo saved diving full-stretch to his right from the nervous looking Seri.
The one-man advantage was taking its toll for the Ivorians though as they piled on the pressure and they eventually got their reward when Griffiths poked home from two yards out.
He might have given his side the lead as well when he headed wide with the goal at his mercy, while at the other end Bhongolwethu Jayiya wasted a one-on-one opportunity with Ibrahim Kone in the Ivorian goal as the keeper kept out his effort from close-range.
Egypt beat Gabon 1-0 in the other pool match on Sunday, to leave the Young Pharaohs top of the group after the opening matches.
South Africa line-up: Brilliant Khuzwayo – Gladwin Shitolo, Sibusiso Mxoyana, Eric Mathoho, Thulani Hlatshwayo – Thandani Ntshumayelo, Sameehg Doutie, Thamsanqa Sangweni, Sibusiso Khumalo (Christopher Flandorp 61st) – Rodney Ramagalela (Kulegani Madondo 58th), Phumelele Bhengu (Bhongolwethu Jayiya 75th)