Nevertheless, the judge said, Moataa deserves discounts for pleading guilty, for co-operating with authorities and for the first-time offender's otherwise good standing in the community.
Moataa pleaded guilty in October to injuring with intent to injure and theft of items under $500. He had initially been charged with aggravated robbery.
Co-defendants Stanley Isaac Ramese, 25, and Simon Tavita, 24, remain charged with murder. The 21-year-old who died has name suppression.
A third co-defendant, Kitiona Isaac Stanley, 27, is charged with injuring the same man as Moataa.
Osa and the person who died had been socialising with two other friends and playing music at Manurewa's Jellicoe Park on the night of October 3 last year when the confrontation took place, authorities previously said.
Moataa lagged behind as the fight started, but was called on to stop Osa from escaping, according to a summary of facts. Osa was punched repeatedly in the neck and shoulders and kicked multiple times after he fell to the ground, court documents state.
"After this assault, the defendant Mr Moataa forcibly removed Mr Osa's pants, shoes, and a small shoulder bag containing Mr Osa's wallet, as he was concerned that they may have his DNA on them," the summary of facts states.
Osa suffered a cut and bruising. He did not attend the hearing on Tuesday, but in a victim impact statement provided to the court he said the attack left him bitter and deeply humiliated.
"He said in it that he does not know the people who attacked him and the attack was, from his point of view, totally random," the judge pointed out. "Nothing had been done by anybody in his group to provoke the attack."
Osa, a warehouse worker who had recently immigrated to New Zealand and had limited English, also said he felt "helpless and extremely scared" during the attack, which "left him with a sense there was a dark cloud over him".
"It's clear the assault on him left a long-standing if not indelible mark on him," Justice Davison said.
Defence lawyer Quentin Duff pointed out that his client participates every weekend at Congregational Christian Church of Samoa in Auckland, an evangelical denomination where his wife's parents are ministers.
He said the attack was extremely out of character for his client and he urged the judge to consider it as separate from the alleged action of his co-defendants resulting in death. It would be "wrong and artificial" to consider them together, he argued. The judge, however, disagreed.
Prosecutors 'Aminiasi Kefu and Jasper Rhodes, meanwhile, argued that the judge should consider the violence of the attack and the undignified treatment of Osa as aggravating factors. The judge did.
The injury charge carried a maximum penalty of five years' prison, while the theft charge was punishable by up to three months incarceration.
Under terms of his six-month community detention sentence, which will include one year of supervision, Moataa will be required to abstain from alcohol and will have a curfew. He was also ordered to serve 250 hours of community work.
He had been so drunk on the night of the incident that he doesn't remember much of what happened, he told authorities in a pre-sentencing report, adding that he had abstained from alcohol since then. He blamed his participation in the events - rather than alerting authorities - on his intoxication and peer pressure.
Moataa's co-defendants had been set to go to trial in November, but all jury trials in Auckland have been postponed since August, when the Delta outbreak lockdown began.