Abafana Bes'thende prevailed thanks to stunning strikes from Siphelele Magubane, Kudakwashe Mahachi and an own-goal from Mzwanele Mahashe, while Victor Letsoalo struck twice for the visitors in KwaMashu.
Bakgaga looked to have scored a last-gasp equaliser from a dubious penalty, but Gomes seemingly penalised Marshall Munetsi for encroaching into the box before the kick was taken. He then awarded an indirect free-kick to Arrows when such an infringement requires the penalty to be retaken if the initial attempt found the back of the net.
The result nudged Clinton Larsen's side into eighth place on the table with 35 points from 28 matches, while Baroka remain bottom of the standings with 24 points - a point shy of Highlands Park, who hover above the drop zone with two games left.
Arrows attacker Mahachi threatened early on, as he had a shot deflected wide for a corner, which was defended by the visitors.
Maboke Matlakala thought he had given Bakgaga the lead in the 11th minute but his finish from close range was disallowed for offside from Gomes.
Soon after Matlakala's teammate Jose Garcia rattled the side-netting with a first-time strike on the run.
Abafana Bes'thende, however, stole ahead in the 40th minute, as Magubane bagged his first topflight goal with a screamer into the top corner from distance.
Baroka almost drew level on the stroke of half-time but Matome Mathiane made a brave goal-line clearance.
Bakgaga eventually found a way back in the 70th minute, as Letsoalo punished some poor defending with a clinical finish in the box.
However, Larsen's team hit back with interest, as Mahashe stumbled when trying to clear Lerato Lamola's effort off the line before Mahachi made it 3-1 with a beautiful chip in the 78th minute.
Letsoalo restored hope for the visitors as he completed his brace in the 86th minute when he prodded home in the area.
Baroka were gifted a spotkick at the death when one of their players collided with goalkeeper Nkosingiphile Gumede, who did nothing wrong when collecting a ball into his box.
Richard Matloga netted with his strike, but Gomes disallowed the effort in confusing circumstances.