At an impromptu party at a Redfern sharehouse, a group of friends drank wine, chatted and played games late into the night.
An American backpacker, who had been invited to the party by her new boyfriend, fell asleep alone on a couch downstairs in the early hours of December 12, 2015
But soon she was woken by a man, who allegedly climbed on top of her and raped her, saying "This is what you want, isn't it? This is what you want?"
Scott Harry Richardson, 25, who lived at the flat, is charged with two counts of sexual intercourse without consent. He has pleaded not guilty.
In his opening address to the jury at the Downing Centre District Court on Tuesday, Crown prosecutor Brett Hatfield said the jury would hear evidence the woman pushed the man away and said "stop".
About 6am, people in the flat heard the woman screaming: "I can't believe this happened. I was raped."
Crying and confused, she also said: "I was literally just sleeping."
The woman rushed upstairs and told her boyfriend what happened, describing her attacker as a man in a white shirt with black hair.
Mr Hatfield said the woman then saw Mr Richardson lying in bed asleep next to his girlfriend, with his white shirt on the floor, and she identified him as the man who raped her.
Mr Richardson was arrested after 7am, and was interviewed by police.
"The accused said 'I assumed it was my friend who had passed out [on the couch]."
Mr Hatfield said Mr Richardson told police: "If I wanted to do that I'd go upstairs to my partner who I live with, who lets me do that."
He told police there was a doona between them and there was "not a single chance" his DNA would be found on the woman.
Mr Richardson's defence barrister, Bernard Brassil, said there would be several issues in dispute.
"A surprising number of the people who give evidence for the Crown don't tell the same story," Mr Brassil said.
"They've all been drinking to various extremes.
"You have your own experiences of life, you know about the effects of alcohol on their reliability, on their clarity of memory ... and their ability to retain the detail of what took place."
The trial continues before Judge Chris Hoy.