A young man accused of assaulting a Sydney resident with a chainsaw claims he and his mates were trying to visit a brothel when they became involved in a fight with locals.

Justin Clarke and Jayson Nichols, both 21, appeared separately before Newtown Local Court on Tuesday after the violent altercation on an Annandale street left a 63-year-old man with lacerations.

A third man, also in his 20s, remains on the run, NSW Police say. The brawl, caught on CCTV and also filmed by bystanders, began when the trio walked up two flights of stairs and entered a home on Monday evening, a police prosecutor told the court.

The men say they thought they were entering a brothel but only had a Coles Myer gift card with them to pay for any sex, the prosecutor added. They were confronted by the residents and a fight broke out which spilled onto the street.

Footage allegedly shows Clarke, wielding an electric chainsaw — which wasn’t switched on — striking out at the residents of the home while neighbours attempt to fight him and Nichols off.

The prosecutor called it an “extremely serious” and “terrifying assault” while their legal aid lawyer said Clarke and Nichols had been forced to defend themselves from the angry residents.

But the magistrate agreed with police that the men had a “history of violence” and were a risk to the community if released.

She refused their requests for bail adding jail time was “more than likely” if they were found guilty.

Clarke, with a graze on his left cheek, left the courtroom in silence, while Nichols shouted at the magistrate as he was led from the dock. They are expected to reappear at Central Local Court on February 13.