Makhehlene Makhaula got the winner in time added on to move Ea Lla Koto up to seventh spot, while Ajax drop to ninth.
The away side enjoyed more possession in the opening stages and were awarded a free-kick just outside the Stars’ box in the 12th minute, but Erwin Isaacs fired wide.
Ajax striker Prince Nxumalo – who had 10 goals in as many start coming into this game – shot wide just before the break.
A lively second-half followed, with Ajax keeper Anssi Jaakkola saving Lucky Mohomi's free-kick in the 58th minute.
Ten minutes later, Stars keeper Diakite went down injured and he was replaced by young shot-stopper Johnny Mathole.
Danny Venter’s shot was saved shortly afterwards, but the winner eventually came for the hosts, with Makhaula firing home a left-footed shot in time added on.