The court heard Cowley was at the worksite in central Hamilton on November 8 and the victim was in her bedroom nearby.
She could see him standing in the kitchen of the neighbouring building with his pants around his ankles and masturbating as he looked at her.
He only stopped when another neighbour walked past.
Two days later, at 7.45am, the woman was in her bedroom putting on make-up when she looked up and saw Cowley doing it again.
Judge Clark said on both occasions the woman felt ill and she now had that “horrible image” stuck in her mind.
Cowley told a pre-sentence report writer the offending was “out of character, opportunistic, and inappropriate”.
Tran said his client had been proactive with his rehabilitation; attending weekly counselling sessions to help work through his issues.
He was remorseful and had tried to engage in restorative justice but it never happened. He was also keen to pay the victim emotional harm reparation, Tran said.
Instead, Cowley had written a letter of remorse which would be passed to the police officer in charge.
“No doubt you found all of this rather embarrassing … and your marriage has also been impacted and affected,” Judge Clark said, adding it was lucky Cowley wasn’t facing two charges.
Cowley was convicted, sentenced to 12 months of supervision and ordered to pay $500 emotional harm reparation within seven days.