Auckland were able to break in the 29th minute when Roy Krishna had his shot blocked. The New Zealand side then had a decent shout for a penalty kick turned down after midfielder Cristobal wriggled free only to be clipped on his way through.
Raja recovered quickly and took the lead when Karrouchy found Mouhssine Iajour in the box, who slotted his left-foot shot into the far corner past Tamati Williams six minutes before halftime.
But the 34,000 crowd were left in stunned silence when Fijian international Roy Krishna capitalised on a defensive error by Mohamed Oulhaj and Ismail Benlamalem, allowing the speedy front man to slot home the equaliser on the hour.
The match looked headed for extra time before Williams palmed away an Oulhaj header only as far as Hafidi, who slotted home the rebound to break Auckland City hearts and send the stadium into a state of delirium.
"I think we've done fine in the sense that we adapted,'' Tribulietx said. "It's difficult for people to understand the difference between the level of football we play at in New Zealand and the atmosphere we played in tonight.
"We've done reasonably well we've shown we're capable of competing at this level and we could've got a better result had things gone our way.''