Jointly charged was Rickie James McCutcheon, 39, who previously pleaded guilty to four counts of sexual connection with the victim, who was then 15.
Judge Macdonald sentenced him to two years, three months' imprisonment. It was noted he had no form for such offending.
The defendants were drinking with a small group of friends at a Dunedin flat on December 4, 2017.
The teenager arranged for the victim to be picked up and brought to the property, ''despite their relationship being turbulent at the time'', the court heard.
After drinking through the evening, the defendants left at 10pm.
The victim, who was ''relatively sober'', went too.
When they ended up back at the younger defendant's bedroom, he told the girl both he and McCutcheon wanted to have sex with her.
''They both repeatedly insisted that she remove her clothing,'' court documents said.
The pair performed an array of sex acts on the girl before they all went to sleep.
In the early hours of the following morning, the victim got up to use the bathroom and when she returned, the teen had sex with her.
At 10am, McCutcheon drove the girl to the Octagon ''and while en route, pleaded with her not to tell anyone what had happened the previous night''.
She ignored the man's appeal.
That night, the victim went to the Dunedin Sexual Health Clinic, where examination found a 30mm tear to her anal canal.
A week later, police interviewed the defendants.
McCutcheon declined to make a statement, while the younger man admitted the girl had stayed with them.
However, he denied any intercourse had taken place.
That stance changed this year when more serious charges were amended to their current form.
McCutcheon's counsel Sarah Saunderson-Warner said while her client accepted responsibility, his recall of the incident was patchy because of his level of intoxication.
The case had been delayed by the man's deteriorating mental health but Saunderson-Warner said he had wanted to apologise to the victim in person.
A restorative justice conference was not arranged.
Aside from the physical harm the victim suffered, the court heard she had spent the year following the trauma struggling to sleep and considering self-harm.
While Judge Macdonald stressed the seriousness of the charges, he said the episode did not appear premeditated.
''It's my impression what happened on this night had an air of spontaneity about it,'' he said.
Where to get help:
• If it's an emergency and you feel that you or someone else is at risk, call 111.
• If you've ever experienced sexual assault or abuse and need to talk to someone call the confidential crisis helpline Safe to Talk on: 0800 044 334 or text 4334.
• Alternatively contact your local police station
• If you have been abused, remember it's not your fault.