Johannesburg - Cape Town City scored from a 98th-minute penalty that should not have been awarded to beat Polokwane City 1-0 Friday in the South African Premiership.
It has left referee Cedric Muvhali on the receiving end of some heated criticism.
Big-screen replays showed a Polokwane player controlling the ball with his chest, but Muvhali ruled handball.
Lehlohonolo Majoro, who had earlier been denied a legitimate goal, calmly converted the spot-kick after sending goalkeeper Howard Ndlovu the wrong way.
A sixth-round match that delivered minimal entertainment for the Cape Town Stadium crowd on a chilly, windy night, sprang to life after 88 minutes.
An assistant referee flagged Majoro offside when he scored from close range despite being played onside by the Polokwane goalkeeper and a defender on the goal line.
The referee awarded the goal, then changed his mind after consulting the assistant.
"It was not the way I wanted to win the match, but three points is three points," said Cape Town coach and 2004 UEFA Champions League winner Benni McCarthy.
The former Porto star had complained about poor refereeing after City had a goal controversially disallowed in a midweek defeat by Orlando Pirates.
McCarthy has had a mixed start to coaching, winning five league and cup matches from the start of the season, then losing to Kaizer Chiefs and Pirates before edging Polokwane.
It was the fourth straight Premiership loss for Polokwane after a shock win at African champions Mamelodi Sundowns and left coach Bernard Molekwa fearing the sack.
"I could get fired because the referee awarded a penalty that never was," he said. "I am proud of the fighting spirit shown by my boys."
Cape Town rose five places to fourth and Polokwane remained 14th.
On Saturday, leaders Golden Arrows are away to Kaizer Chiefs in Soweto and struggling defending champions Wits host Orlando Pirates in Johannesburg.