The three men were arrested on Tuesday morning; they pleaded not guilty at their arraignment.

John Carman, a lawyer for Mr. Vashovsky, said his client was “not the first landlord to be wrongfully accused by a nonpaying tenant with an obvious and substantial reason to make false claims.”

Robert Wolf, a lawyer for Mr. Ohana, said in a statement that his client had been cooperative with the city’s Investigation Department and is not guilty.

Aaron Twersky, a lawyer for Mr. Cohen, said the city’s “narrative is not entirely accurate.”

While prosecuting landlords for harassing tenants is rare, city and state authorities have been turning to the courts more frequently to crack down on the landlords suspected of wrongdoing. The most prominent example: Steven Croman, whose companies controlled more than 140 Manhattan apartment buildings, was charged in May with 20 felonies.

Mr. Vashovsky’s companies own at least 26 buildings, mostly in Brooklyn, records show.

In June 2015, a two-story townhouse on Tompkins Avenue in the Bedford-Stuyvesant neighborhood of Brooklyn partially collapsed after one of Mr. Vashovsky’s companies, Vasco Ventures, bought it, two neighboring townhouses and a vacant lot, intending to build an apartment complex. The Buildings Department attributed the collapse to the failure to brace a wall during tear-down work.

When another of Mr. Vashovsky’s companies bought the building at 14 East 125th Street in East Harlem for $1.85 million in February 2013, residents started complaining of rats and lack of heat, and within months, five of the six rent-regulated residents moved out.

But officials said the tactics at 21 East 115th Street in East Harlem were particularly egregious.

After Mr. Vashovsky bought the five-story, 10-unit building for $3 million in May 2014, workers soon began tearing the building apart from the inside out. Even as the outside walls remained, the building inside was gutted almost to its bones — the defendants are accused in court papers of “removing all internal walls and floors of all other apartments in the building, creating a risk of falling from a height of five stories and leaving said fall risk exposed behind unlocked doors.”