Police also found a glass pipe, cannabis and $700 in cash. He was charged in relation to the finds.
The court was told that nine months later, Nieuwenhuiysen was living in a cabin at a Waiwera camping ground.
Ms Chang said Nieuwenhuiysen contacted a prostitute through an escort website and invited her up to the cabin.
She said the woman arrived and the pair agreed on a price of $400 and to swap her older cell phone for his newer model.
Ms Chang said Nieuwenhuiysen went to the fridge and poured her a ginger beer.
The woman then went out to her car to put the money away before returning to the cabin for a chat.
"Its from there that things take a turn,'' Ms Chang said.
She said the prostitute passed out. "The next thing she remembers is waking up hazy and confused.''
Ms Chang said at one point she came-to to find Nieuwenhuiysen on top of her having sex.
She said he later became angry with the woman, saying that she had fallen asleep.
The prostitute replied: "You're the one who drugged me.''
Ms Chang said the woman would tell the court that Nieuwenhuiysen then tried to swap back the phones and take back $200.
The woman laid a complaint with police.
"You may be thinking that she is a prostitute, that she agreed to go to his home for sex and she was paid for it,'' Ms Chang told the court.
But that did not give Nieuwenhuiysen a "blank cheque'' to do what he wanted.
"She did not consent to be rendered unconscious and have sex in that state.''
Police later searched the cabin and found 12.6g of cocaine in a Click-Clack container on the roof with a street value of $5000.
Inside the cabin they found a Red Bull can containing the date-rape drug GHB.
Nieuwenhuiysen's lawyer Hugh Leabourn told the court that the Crown's opening had "plastered over some major cracks''.
"There is a plethora of evidence which doesn't exist.''
He said there were two trials going on and the jury should not let one cloud the other.
Mr Leabourn said Nieuwenhuiysen was only in possession of the Rav 4 for a matter of hours before police pulled him over. He said other people had had the car for weeks.
"You might think that is very, very, very important.''
He said the jury would need to assess the credibility of the rape allegation.
"The issue for the accused is, did sex take place?''
The trial has been set down for eight days and is due to hear from 18 witnesses.