Ibrahim Saddam Juma put the east African club ahead after 74 minutes at Nelson Mandela National Stadium in Namboole near Kampala.
Timothy Awany clinched a famous victory for the Ugandan outfit in the second Group A matchday when he converted a penalty one minute from time.
Ahly have been African champions a record eight times while City Authority reached the group phase of the elite African club competition for the first time this season.
Defeat leaves Cairo-based Ahly with just one point after two rounds having been held 0-0 at home by Esperance of Tunisia this month.
Kampala began with a 1-0 loss at fellow group newcomers Township Rollers of Botswana, making the Ahly clash a must-win affair for them to have a realistic chance of progress.
Group winners and runners-up advance to the quarter-finals of a competition offering a $2.5 million (2.1 mn euros) first prize and a place in the 2018 FIFA Club World Cup.
Kampala and Rollers, the outsiders in the group, have three points each and Esperance and Ahly one apiece.
Esperance, who have been African champions twice, host Rollers later Tuesday in Rades near Tunis and victory will lift them to the top of the standings.
In Group D, Felix Badenhorst scored on 60 minutes to give Mbabane Swallows of Swaziland a 1-0 home win over Primeiro Agosto of Angola in Manzini.
When the ball was pushed back to the tall Swazi, he rifled a deflected shot into the net from outside the box.
Primeiro came closest to levelling soon after when veteran Afonso Cabungula grimaced after his header rebounded off the post.
Swallows have four points, former champions Etoile Sahel of Tunisia three and Zesco United of Zambia and Primeiro one each.
Etoile host Zesco in Mediterranean resort Sousse on Wednesday and a win for either club would bring them level with Swallows, the first Swazi side to reach the group stage.