It is unclear if the building’s landlord plans to appeal. David Loshak, a partner in the company that owns the 40-unit building, declined to comment. But other building owners were disappointed in the decision, which they feared could have wide influence.

Jay Martin, executive director of the Community Housing Improvement Program, which represents about 4,000 landlords who own mostly rent-stabilized buildings, said he sympathized with Ms. De La O. “How could you not?” he said.

But he said the next case could look very different. Because inheritance rights are not based on income, people who do not need a low-priced home can take advantage of the law, especially now that a judge has interpreted it more broadly than it has been, Mr. Martin said. Rent-stabilized apartments are not as strictly governed as rent-controlled ones, but the same succession rules apply, meaning the new ruling could have a significant effect.

While prices of many rent-controlled apartments remain essentially frozen at 1970s levels, property taxes and utility costs have not, Mr. Martin said.

“We’re locked in this argument where it’s landlords versus tenants,” Mr. Martin said. “It gets the blood boiling, but never gets at the issue. Many landlords are struggling with same costs that the tenants are.”

Judge Jeannine Baer Kuzniewski, who issued the ruling, declined to comment through a spokesman for the courts.

Ms. De La O and Ms. Valentin had each traveled a long way before their meeting late in life.

Ms. Valentin grew up in France and immigrated to New York as a young nanny, following the family whose children she minded. After an early romance ended in heartbreak, she never married and did not have children, said her nephew, Rémy Valentin.