The Crown says a Wainuiomata man was killed when a planned drug theft went wrong.
Paul Te Hiko died of a gunshot wound in the lower chest, in March last year.
Falcon Samuels, 30, is on trial in the High Court in Wellington, accused of his murder.
Crown lawyer Adele Garrick said the night Mr Te Hiko died, Mr Samuels and two acquaintances had planned to steal drugs from him.
Mr Te Hiko was living in a container that had been converted into a sleep-out on a new subdivision that he worked on in Wainuiomata, which was owned by his father.
Also on the site was a building known as The Dojo, which Mr Hiko's father had used previously for martial arts training. It had a living area on one end, with a kitchen and lounge.
The three men planning to burgle The Dojo had gathered at a house known to be a gang headquarters to discuss stealing drugs from Mr Te Hiko, Ms Garrick said.
They were dropped at the site by an acquaintance, after telling him they were going to a party.
Ms Garrick said in his bag Mr Samuels had a crowbar, and a sawn-off shot gun.
He attempted to get in the door, which was locked. He ran back to the other pair and took out the shot-gun, telling them he'd probably need it, then looked in a window and saw Mr Te Hiko was home.
He told his accomplices he was "up for anything", according to the Crown, but they decided to leave, taking a path through the bush at the back of the subdivision.
But the defendant did not leave, Ms Garrick said.
"He stayed behind. He approached the building where Mr Te Hiko was. Paul Te Hiko came out down the back steps, holding an axe."
Mr Samuels shot him at close range, Ms Garrick alleged, and in doing so, committed murder.
The pair on the path heard loud arguing, and the shot going off, she said.
As they were leaving Mr Samuels joined them in the car, and they were all taken back to the gang pad.
Paul Te Hiko was found by two friends, who alerted his father, and was on the phone to ambulance staff when he confirmed his son was dead.