New York City has warned landlords, employers and businesses they could be running afoul of the law by purposely calling a transgender woman "him" or "Mr." when she prefers a female title and pronoun, or by barring her from using a women's restroom.

New guidelines detail the legal protections of transgender and gender-nonconforming New Yorkers and what constitutes discrimination under the city's Human Rights Law, the New York City Commission on Human Rights said on Monday.

RELATED:  PHOTOS: 12 transgender celebrities and public figures you should know

"Today's new guidelines strengthen those laws by ensuring that every transgender and gender non-conforming person in New York receives the dignity and respect they deserve," Mayor Bill de Blasio said in a statement.

The guidelines said dress codes requiring men to wear ties or women to wear skirts are discriminatory.

Failing to provide employee health benefits for gender-affirming care or failing to accommodate people undergoing gender transition, such as medical appointments, could violate the law as well, they said.

RELATED: Transgender model aims to adopt child conceived from her frozen sperm

"It's a huge step forward and really catapults New York City to the forefront of the struggle for transgender rights," said Michael Silverman, executive director of the Transgender Legal Defense and Education Fund, a nonprofit law office based in New York.

Three-quarters of transgender New Yorkers have reported harassment and mistreatment in the workplace, and more than half said they had been verbally harassed or disrespected in public, according to a survey cited by the Commission on Human Rights.

One in five said they had been refused a home because of their gender identity, the 2011 survey said.

New York City provides stronger protections than most local laws in the United States and goes beyond federal law as well, said Silverman and other advocates.

RELATED: Hearing for transgender rights bill packs house

"By issuing some of the strongest and most comprehensive legal guidance in the country, New York City has taken a major step toward ensuring that transgender and gender non-conforming New Yorkers can enjoy dignity, respect and access to opportunity in our city," said Donna Lieberman, executive director of the New York Civil Liberties Union.