A man allegedly performed a sexual act while dancing on a neighbour’s doorstep and looking in at her, a court heard today.