The defending champions once again produced a lackluster performance but managed to secure a fifth consecutive victory that moved them up to second in the league table.
Just when ENPPI appeared content to hold Ahli to a draw at Cairo Stadium, mercurial midfielder Barakat was found unmarked at the far post to send a low shot home from close range two minutes into stoppage time.
The victory will come as a major boost for coach Hossam Al-Badri, who was criticized by many of the Red Devils' faithful following the team's Champions League semi-final exit at the hands of Tunisian side Esperance.
Defender Sherif Abdul-Fadil gave Ahli an early lead after a dreadful mistake from ENPPI keeper Mohamed Abou-Gabal but striker Ahmed Abdul-Zaher equalized on the quarter-hour mark.
Winger Islam Awad put ENPPI ahead after rounding off a swift move on 70 minutes but Geddo restored parity just four minutes later.
Barakat rescued a below-par Ahli side with a last-gasp goal to give their disgruntled fans, who lifted a banner criticizing Al-Badri, something to cheer about.
Ahli have 17 points, just one behind leaders and arch-rivals Zamalek who were held to a 2-2 draw by Gaish earlier in the day.
The Red Devils, who are the only team not to taste defeat this season, will move top if they win their three games in hand. ENPPI lie sixth with 14 points from 10 games.
Abou-Treika on bench
Classy playmaker Mohamed Abou-Treika was kept on the bench after failing to shine in the past few games.
Ahli supporters backed their favorite player though, lifting a banner that read: "for those who want Abou-Treika to retire - there is an ordinary player born everyday but Abou-Treika is a legendary figure".
A three-pronged attack featured Geddo, Barakat and Liberian Francis Doe after he recovered from a hamstring injury.
But it was natural right-back Sherif Abdul-Fadil, who played on the left due to the injury of Sayed Moawad, who opened the scoring as early as the sixth minute with a fortunate strike after his cross-cum-shot tricked the shaky-looking Abou-Gabal.
Striker Abdul-Zaher brought ENPPI level on 15 minutes when he slotted home the rebound after an initial shot by Walid Soliman, who escaped his marker to receive a cross unmarked, was blocked by keeper Sherif Ekrami into his path.
Ahli were second best to ENPPI as they gave too much space to the petroleum side to launch wave after wave of attacks.
ENPPI's pressure paid dividends in the 70th minute when lively winger Awad exploited a gap in Ahli's defense to latch onto a neat pass from Mohamed Aboul-Ella and beat Ekrami with a powerful right-foot shot.
Al-Badri introduced Algerian out-of-favor playmaker Amir Sayoud instead of ineffective midfielder Hossam Ghaly to inject zeal.
Sayoud, making his first competitive appearance this season, was energetic but his touches were not so accurate.
Egypt forward Geddo, who scored Ahli's winner over Petrojet last week, equalized in the 74th minute after Abdul-Fadil and Doe combined on the left to feed him for an easy tap in.
Barakat sent the home fans into raptures with a precise finish deep into the additional time to break ENPPI's hearts.