He discharged Ali without conviction on the condition he pay the victim $1500.
The court heard he was studying English at Otago Polytechnic while his sister studied for her PhD.
Ali invited the victim to his apartment for drinks on November 4, and she arrived to find him socialising with friends.
The defendant offered the woman a bottle of beer but because of its effects she went home and slept for several hours.
At 10pm, one of Ali's associates invited her back to the gathering and she returned.
''A large glass of straight vodka was poured for her. She drank the vodka over one or two hours and she felt dizzy and very intoxicated,'' a summary of facts said.
Early next morning, most of the group decided to continue their revelry in town but the victim asked Ali to walk her home.
They sat on the couch and the defendant suggested she should change into her nightwear.
''Once he had removed all of her clothing and the victim was naked he made no attempt to put any pyjamas on her,'' the summary said.
Ali pulled the naked, sleeping woman on top of him, pulled out his phone and took five photographs.
''It doesn't really get more intimate than a picture of the genitalia of a person,'' Crown prosecutor Catherine Ure said.
In three of the photos, the court heard, Ali was visible and clothed.
When spoken to by police, he said he was ''very drunk'' and could not remember what happened.
Ali admitted removing the victim's clothes but said he did not recall taking the intimate pictures.
The victim, who was now living with family overseas, suffered a ''serious emotional crisis'' over the incident, the court heard.
She said she wanted Ali to face the truth and take responsibility for his actions.
Stevens said her client had planned to study here only for a semester and was desperate to get home to his mother and five siblings.
Ali was young, she said, in every sense of the word - ''away from his family ... with absolutely no experience of social interactions of this nature''.
She was adamant her client was not a sexual deviant.
''There are so many adolescents out there sending photos of their anatomy to each other; penises, you name it,'' Stevens said.
Ali's flight home had been booked, the court heard.