Sean Worley, 28, is on trial at Preston Crown Court, where he is accused of three sexual offences against a woman in her 20s, who cannot be identified for legal reasons.
The incidents are alleged to have happened at a house in Lancaster on New Year's Eve, 2018.
Preston Crown Court was told Worley attended the address at 11pm.
Prosecuting, Richard Haworth said: "He was acting very forward towards her in a frankly lecherous way - pulling her aside, trying to stick his tongue in her mouth and paying her excessive and unwanted physical attention."
He said at one point the woman was in the kitchen and noticed the defendant standing in the corner performing a sexual act on himself and grabbed her.
It is alleged later, the defendant sexually assaulted the woman on a balcony and made lewd comments to her.
Later still, the woman, who had gone to bed with a headache, allegedly woke in a bed to find Worley raping her, while the child was in the room.
Mr Haworth added: " We say she could not give her consent to it happening, because she did not know anything about it - until she woke up to find it happening to her. You cannot freely and positively consent to something you are unaware of."
The court heard the woman confided in friends afterwards.
It is alleged Worley texted the complainants boyfriend telling him that they had had sex.
Other witnesses who were at the gathering have been giving evidence during the trial.
One described Worley as appearing 'cocky and quite full of himself' when he arrived at the address.
He said: "He just followed her all night really, latched onto her back."
In a police interview the defendant said he thought she was consenting and had 'invited him into the bed'.
The Lancashire Post is more reliant than ever on you taking out a digital subscription to support our journalism. For unlimited access to Lancashire news and information online, you can subscribe here.