“This is a particular moment in history when judges, just like the rest of us and the public, are very aware that there is a huge social problem for victims of gender-motivated violence, and the concerns that motivated the City Council to pass this law in 2000 are sort of even more present today than they were then,” said Zoe Salzman, a lawyer for the plaintiff in the case.

The ruling came in a sexual assault lawsuit against Paul Haggis, the film director and writer, filed by a young publicist, Haleigh Breest. Mr. Haggis contends their encounter was consensual, and the court did not rule on whether Ms. Breest had proven her case, which could be headed for a jury trial.

The question before the court was whether Ms. Breest could sue Mr. Haggis under New York City’s Victims of Gender-Motivated Violence Law, which says that a violent crime “committed because of gender or on the basis of gender, and due, at least in part, to an animus based on the victim’s gender” is a civil-rights violation.

Mr. Haggis argued that the law should not apply to his case, because, he said, there was no evidence of hatred against women as a group. But the court rejected that argument, saying that the act of forcing sex alone was enough to qualify as gender-based animus.

“Without consent, sexual acts such as those alleged in the complaint are a violation of the victim’s bodily autonomy and an expression of the perpetrator’s contempt for that autonomy,” Justice Peter H. Moulton wrote in the opinion. “Coerced sexual activity is dehumanizing and fear-inducing. Malice or ill will based on gender is apparent from the alleged commission of the act itself.”