It's also alleged he then returned to the house a few hours later, while the neighbour was still at work, lowered his trousers and again masturbated.
During a pre-trial hearing at the Hutt Valley District Court earlier this year, the man's lawyer, Shanna Bolland, argued her client could not intend to assault or offend if he was not aware that he was being recorded.
Bolland believed there was insufficient evidence that there was an intention to offend any person, whereas masturbating in front of a person would likely cause offence.
In the same court hearing Crown lawyer Mark Shaw argued the charge of being in the woman's home unlawfully didn't cover the gravity of the man's alleged offending.
Shaw said just because she wasn't there, and wouldn't have known about the incident without the camera, it did not mean his actions weren't offending against her privacy.
In a reserved decision, Judge Chris Sygrove dismissed the charge of burglary.
"My assessment is that, there is no exhibition if there is no audience", Sygrove said.
He said being reckless as to being caught and how someone might feel about such behaviour was different to intending to cause offence or insult by that behaviour.
"I agree with the defence that the Crown cannot prove this element beyond
reasonable doubt if there is insufficient evidence to prove that [he] was at
least aware, if not that he intended, that the complainant would see his indecent act."
The charges relate to alleged incidents last year. The case will back in court later this year.