Defending champions Ahli needed to win to keep alive their Egyptian Premier League hopes by setting up a decider against Ismaili, who crushed Tersana 3-0.
The Red Devils surprisingly fell behind to Ahmed Abdullah's opener six minutes after the restart.
They pushed forward to claim the equalizer and their efforts paid off when a Mohamed Abou-Treika header found its way into the net.
Gaish players confronted referee Mohamed Risha to protest his decision not to disallow the goal. Television replays suggested that Abou-Treika might have shoved an opponent in the build up.
"The referee helped Ahli to win today," a furious Gaafar told Al-Hayat TV after the match.
"All of us saw him whistling for a free-kick just before Abou-Treika's header so we were astonished when he allowed the goal to stand."
Two stoppage-time goals by Ahmed Fathi and Mohamed Talaat gave Ahli all three points.
"Ahli are a great team, they don't need assistance from the referee to win," Gaafar added.
Gaish will have to wait for Thursday's league ties to know whether they will keep their seventh-placed position or not.
Police Union, Ittihad and Masri have a chance to leapfrog them.