The win, which would have been their third of the campaign, would have moved Ezenkosi to 14th place and taken some pressure off as they fight to lift themselves from the relegation zone.
The hosts took a 1-0 lead at the interval after a 29th minute own-goal from Stars defender Sadate Ouro-Akoriko, who chipped a back pass over goalkeeper Kennedy Mweene.
Cosmos doubled their lead soon after the break through a classy lob from midfielder Matthew Rusike in the 48th minute.
Lapses in concentration at the back, however, saw them concede a minute later through substitute midfielder Tshidiso Mosikidi as Stars attempted to graft their way back into the match.
The visitors equalised midway through the second period when midfielder Dove Wome drilled in a strike from the edge of the box.
The hosts, spearheaded by lone striker Siyabonga Nontshinga, dominated the first half.
Nontshinga, however, was clumsy with his best effort, after 34 minutes, when he handled the ball after attempting to control with space available and only Mweene to beat.
Stars were a far better unit in the second stanza, with their opening goal through Mosikidi enthusing some energy in the side.
This forced panic buttons in the Cosmos defence, with the home team pinned back for the final half hour of the match.
Stars pushed forward in the dying stages but they lacked composure and were unable to find the winner.