The four are all members or associates of the Mongrel Mob gang and were remanded to reappear on July 14.
Mr Rata, 35, was badly beaten in Bonnett Rd, Kaitaia, while a wedding party was taking place at a nearby home. He was found by a passer-by, who called emergency services, but died the following day in Whangarei Hospital.
Sergeant Shane Turner said one person involved in the scuffle outside court was related to Rata while another knew Pairama.
While coming downstairs, Rata's relative took exception to something the other man said and followed him to the car park.
Verbal exchanges took place before the men threw punches at each other, police said.
Court security officers separated the two men before one went to a car parked on the road opposite court and allegedly retrieved a hammer.
Court security moved in quickly and managed to take the weapon off him. Police were called and the car was searched but nothing else of interest was discovered. No one was injured in the stoush.
The hammer wielding man is facing charges of possession of an offensive weapon and disorderly behaviour and has been bailed to appear in Whangarei District Court on May 5. The other man was let off with a warning.