Identical 2-2 draws against Rayon Sports of Rwanda and a 2-0 win against Port pf Djibouti had given the Dylan Kerr led side rights to progress to the quarters.
K'Ogalo could not find their footing in the first fifteen minutes, and it was no surprise when they fell behind courtesy of a Lwanga Tadeo strike.
The Green Army defense was caught napping, failing to shut Nsefuka Rahmat, who did well to find his teammate.
George Odhiambo, new boy Francis Mustapha and Jacques Tuyisenge had half chances to get the Kenyan side into level terms in the first half but they failed to take them.
Two minutes after the break, it was one all; this time round Tuyisenge managing to hit the right button for the sixteen-time Kenyan Premier League champions.
With about fifteen minutes left, Mustapha made amends for his misses by firing in what turned out to be the winner.
Gor Mahia XI: Boniface Oluoch, Philemon Otieno, Godfrey Walusimbi, Haron Shakava, Charles Momanyi, Ernest Wendo, Innocent Wafula, Humphrey Mieno, Jacques Tuyisenge, Francis Mustapha and George Odhiambo.
Subs: Shaaban Odhoji, Bernard Ondiek, Lawrence Juma, Kevin Omondi, Ephraim,Guikan, Samuel Onyango and Francis Kahata.