Tanzania-based Okwi had been a constant menace down the right wing before scoring the only goal on a hot afternoon in the 45,000-seat Mandela National Stadium.
He cut inside an Egyptian, took the ball across another, then unleashed a low shot that flew past 44-year-old goalkeeper Essam El Hadary into the far corner of the net.
Victory lifted Uganda, who have never qualified for a World Cup, to seven points in Group E. Egypt have six, Ghana one and Congo Brazzaville none.
Ghana host Congo Friday in Kumasi and maximum points for the "Black Stars"
will bring them back into contention for a fourth consecutive World Cup appearance.
Only the five Africa zone group winners qualify for the 2018 tournament in Russia.
Liverpool striker Mohamed Salah had two great chances to equalise after Egypt fell behind.
His close-range header off a cross was magnificently parried by Uganda goalkeeper and 2016 Africa-based Footballer of the Year Denis Onyango.
The loose ball fell in front of Mahmoud "Kahraba" Abdel Moneim, but he was unable to control it and fired over.
Six minutes into stoppage time and opportunity knocked again for Salah, who has scored twice for Liverpool in three English Premier League matches this season.
Onyango failed to cut off a corner and Salah connected with the ball at the far post only for the goal-bound shot to rebound off the back of team-mate Ahmed Hegazy.
Salah and West Bromwich Albion defender Hegazy were among four Premier League footballers on show.
Arsenal midfielder Mohamed Elneny also started and Stoke City winger Ramadan Sobhy was introduced at half-time by Argentine coach Hector Cuper.
In Conakry, Alkhaly Bangoura scored in stoppage time to give Guinea a dramatic 3-2 victory over fellow strugglers Libya in a must-win Group A match for both teams.
Leading by two goals from midway through the first half, the Guineans were rocked when Libya netted twice within a minute in the closing stages to equalise.
The first Guinean goal was scored by Naby Keita, who agreed this week to join Liverpool from RB Leipzig for the 2018-2019 season.
Tunisia and the Democratic Republic of Congo, who meet Friday in Rades, share the lead with six points, Guinea have three and Libya none.
There are five qualifiers scheduled for Friday, including Nigeria hosting Africa Cup of Nations title-holders Cameroon in a top-of-the-table Group B clash.