For the last three and a half years, Tomoko Watabe, 49, has made Apartment 1C at 46 Downing Street in Manhattan her home, and it shows.

Desktops are set up in one corner of the white-walled, wood-floored living room. A small cat condo for her feline roommates, Delancey and Charlie, stands in another corner. Lanterns hang on the wall and floor lamps brighten the space.

But Ms. Watabe, who pays $2,000 a month, should not even be living there, according to a court. In an unusual case even for New York City’s complex housing laws, a judge has ordered Ms. Watabe evicted from the one-bedroom unit in the West Village to undo an earlier eviction, that of the apartment’s longtime tenant, an ex-convict who is expected to pay less than a quarter of her rent.

“I didn’t do anything wrong,” Ms. Watabe said. “I always pay the rent on time.”

The former tenant, Otto Thompson, had lived in Apartment 1C since he was 7, and after his mother died more than a decade ago he was the last member of the family in the apartment, which was rent-controlled.