The result takes Jomo Sono’s side up to 25 points, four above the University of Pretoria, and five above bottom-of-the-table Maritzburg United, the latter having played one game fewer.
Cosmos took an early lead, going ahead on 13 minutes when Onassis Mntambo netted directly from a corner kick, with Ajax keeper Anssi Jaakkola allowing the ball to slip through his grasp.
Bantu Mzwakali nearly equalised eight minutes later, shooting just over the bar, before Jaakkola did well to prevent the visiting side from adding a second when he saved from Tebogo Makobela.
More chances were exchanged before half time, at both ends of the park, but Erwin Isaacs and Travis Graham for Ajax, and Cheslyn Jampies for Cosmos, all failed to change the scoreboard.
The Urban Warriors needed just five second half minutes to square up proceedings, Prince Nxumalo finishing smartly for his 12th league goal of the season after a great piece of work from substitute Nathan Paulse for the assist.
Ezenkosi, however, gave the home fans a scare when Sipho Mngomezulu went for goal, and only a brilliant diving save by Jaakkola kept matters level.
But having looked subdued and off the pace in the first half, Ajax were far more fluent in the second stanza, although with the exception of a debutant Ali Abondo’s free kick that went wide and a misplaced header by Nxumalo, the Cosmos goal remained unthreatened for the most part.
Roger De Sa’s men refused to give in and got their goal when Nxumalo latched on to an 86th minute pass from Abubaker Mobara before finishing sublimely with the outside of his right foot.
But the home side’s joy was cut short in the final minute of added time, with Denver Mukamba netting seconds before the full time whistle
Would you like to place a soccer bet? Click here to get started in 3 easy steps.