By 2010, Mr. Hossein said, he had no rental income. He had also been forced to close his small convenience store after losing his lease.

“I couldn’t afford the mortgage,” he said, adding that he later lost the home in foreclosure. “After 2010, I would never go over there.”

Harun Islam, the current owner of the house, said he bought the property in 2014. He said that he had tried to make sure there was no access into the abandoned house, but that squatters have always been an issue.

“There were strangers going in and out when we were not there,” he said. “I could not control it.”

City officials found that the building had been abandoned and taken over by squatters by 2016, according to building records. That same year, the Fire Department requested the vacant house be boarded up, records show.

As late as 2017, an inspector again cited the property as abandoned yet accessible to squatters.

Chief Jardin said on Friday morning that the utility Con Edison had not supplied electricity to the building in approximately two years.

Mr. Islam said the home was sealed off with concrete blocks and boarded up. When he last visited about two or three weeks ago, he said, he did not see anyone present.

“I don’t know how these people entered the house,” he said. “We had no idea.”

Neighbors interviewed on Friday said they did not know the names of the men. Outreach workers often lament the difficulty of cajoling a name out of people living on the street and fringes of New York, where a person’s name is sometimes his or her only possession.