He suffered a burn to his forearm after a bullet passed close to him and was "lucky to be alive'', Detective Inspector Scott Beard said.
Witnesses described the firearm used as looking similar to a police-issue Glock.
The officer pulled over the car after noticing "suspicious activity'' and was taking the car keys off the driver when the passenger fired at him from close range, police said.
The car drove off at high speed and was recovered an hour later in nearby Mt Eden.
Mr Beard said police had searched the vehicle and found a pistol holster in it, although no weapon had been located.
"We do not want this search to end tragically for anyone. The best thing Mr Toleafoa can do is give himself up to police. If any of his associates knows where he is, they should call police,'' Mr Beard said.
Police warned against approaching Toleafoa, who they said could be armed and dangerous.
"Police officers carry out vehicle stops every day, 24/7. Last night's patrol could have ended in tragedy and it's not acceptable that people are driving around armed and, even worse, prepared to shoot at officers,'' Mr Beard said.
"Murray Toleafoa is affiliated to the Tribesmen outlaw motorcycle gang and I urge any member of the gang to contact police''.
Auckland police spokeswoman Noreen Hegarty said the shocked police officer was being supported by his colleagues and would receive counselling.
Several of his colleagues had been "very close by'' at the time he was fired at, she said.
Police Commissioner Peter Marshall condemned the incident.
"While the vast majority of our roadside interactions with individuals take place peacefully and without violence there continues to be a minor element within society who resort to mindless violence.
"Having been out on the streets recently with the frontline, they have my utmost admiration for the way they go about their jobs.''
The incident showed police officers have to be constantly alert for signs of irrational behaviour, he said.
"On the other hand good conversational communication is a police officer's best skill. Maintaining the balance is the art of policing and I take my hat off to my staff's professionalism.''