Michael Keith Robinson has already pleaded guilty to murder and to wounding with intent to cause grievous bodily harm.
Crown prosecutor David Stevens said Joseph Ngamu was shot in the stomach at the Bairds Rd unit and survived, but another man died after a bullet pierced his heart and lungs.
Stevens said Huriwaka was well-known to the Bairds Rd residents, but not to the man who died.
Huriwaka held a grudge against the brother of one resident after a 2019 police complaint, the prosecutor said.
Huriwaka told police the man who complained about him was a "c**t" and a "f***ing idiot", Stevens said.
He went into custody on unrelated matters for about a year, and was released on February 18, 2020.
Ten days later, Huriwaka went with Robinson and a 15-year-old associate to the Bairds Rd unit, where people were drinking and listening to music.
Stevens said Huriwaka mentioned the person who'd made the statement about him, then left. Robinson was unknown to the people at Bairds Rd, Stevens said.
Jurors heard Huriwaka collected an associate aged 17, then drove the group to a Māngere address where Robinson collected a gun.
Stevens said Huriwaka told the 17-year-old to drive, and then park in the Bairds Rd property driveway with the car bonnet facing the road.
"It was not a social visit."
Huriwaka and Robinson approached the unit and a man present, unaware Robinson was armed, invited him in for a drink.
The prosecutor said Robinson presented the firearm at Ngamu, who grabbed the gun and pushed it down.
The gunman then pulled the trigger and Ngamu was shot in the stomach.
Struggles continued, before another man present ran over to help and was also shot.
He fell down and died a short time later, Stevens said.
Ngamu had stomach surgery and a bullet removed.
Stevens said even though Robinson had pleaded guilty to murder, Huriwaka was also responsible for what unfolded when he went to Bairds Rd.
Defence counsel Shane Cassidy said Robinson was a murderer, but acted alone.
"There was no plan, or agreement or understanding, certainly not one that Mr Huriwaka was aware of."
Cassidy said it was problematic to suggest a complaint someone made 12 months earlier could be linked to the shooting of two men who had nothing to do with the complaint.
"Mr Huriwaka did not know that Mr Robinson had a firearm hidden on his body. Only Mr Robinson knows why he did what he did."
The trial before Justice Gerard van Bohemen continues.