Warriors, lying mid-table in the second-tier South Africa First Division, stunned the visitors early on, but Cosmos scored twice in the second period to net a victory, progressing to the last 16.
The hosts showed their intention as early as the 11th minute when Justice Sithole hit the crossbar, reports www.supersport.com.
And three minutes later, Zakazaka made sure when he tapped in from close range to give Warriors the lead.
Cosmos, second from bottom in the Premier League, came out fighting in the second-half, with Siyabonga Nontshinga firing over the bar just after the break.
Their persistence paid off when Zimbabwean Taonga Dondo equalised with 16 minutes left, thundering in a left-footed strike from the corner of the penalty area.
Siyabonga Nhlapo netted the winner after controlling the ball well in injury time and getting a deflection off a Warriors defender.