MASTIC BEACH, N.Y. — They call it "The Matrix," a well-thumbed pile of maps locked in a cabinet at Village Hall that pinpoints all the empty "zombie houses" in this 4.2-square-mile seaside community. There's one on nearly every block.

"It's like a cancer," Mayor Maura Spery said of the scourge. "It's not getting any better. Each one of these is hurting property values for six or seven houses around it. Who wants to live in a place with so many vacant houses?"

The vacant properties are called zombie houses because their ownership is in limbo: mortgage holders have already left, but banks haven't yet taken possession through foreclosure, leaving the properties abandoned and often decaying.

A relic of the Great Recession, zombie houses have receded in many states — but not all. They remain, and are growing in number in several states, including here in New York and in nearby New Jersey and Massachusetts, which together account for 40 percent of the nation's vacant foreclosures. Over the last year, the number of zombie houses also has risen in Oklahoma, Michigan and Washington.

State and local officials like Spery are tired of them and demanding or taking action, saying the public cost of trying to maintain the vacant houses is unacceptable and they are driving down the value of neighboring property.

In New York, a group of mayors are pushing a proposal introduced by Democratic Attorney General Eric Schneiderman that would require banks to take responsibility for maintenance as soon as a house is vacant, so they can't avoid responsibility by postponing foreclosure.

In February, Schneiderman announced a $3.2 billion settlement with Morgan Stanley, part of which will go to local governments to help offset the costs of dealing with the properties.

In Memphis, Tenn., neighbors can now collect a $25 credit toward eventually buying a home each time they cut the grass at an abandoned property under a "mow to own" program. It's an approach that's also been used in St. Louis; Columbus, Ohio; and Rockford, Ill.

In New Jersey, which has more than 4,000 zombies, the most of any state, lenders by law must notify local governments if a property becomes vacant before foreclosure is finished, and be available to help with repairs and maintenance. The law allows towns to fine lenders up to $2,500 a day if they don't comply.

If states or communities fail to act, New York's Schneiderman makes it clear what can happen: "Abandoned homes become magnets for crime, drag down property values and drain municipal coffers."

As the nation's housing market has improved, the number of zombie houses declined from 46,715 in 2013 to 19,793 by the start of this year, the real estate information company RealtyTrac estimates. That's a 58 percent drop.

Entering the year, Suffolk County, N.Y., where Mastic Beach is located, has the highest number of zombies in the country at 625, followed by Camden, N.J., at 596, according to RealtyTrac.

"It's improving nationally but becoming more concentrated in some areas," said Julia Gordon, executive vice president at The National Community Stabilization Trust, a nonprofit that works with local government to free up zombies and other troubled properties for use as affordable housing.

Daren Blomquist, vice president at RealtyTrac, cautions that his firm's estimates may understate the problem, especially in some states — New Jersey and New York among them — where laws demand lengthy court-supervised foreclosure procedures designed to help protect property owners.

A Seton Hall Law School study in 2014 found that New Jersey's system of court-supervised foreclosure "has not worked efficiently" since the housing bust in 2008, contributing to backlogs and abandoned housing.

Many advocates for property owners say foreclosure delays often are caused by banks or contracted loan servicers that deliberately back out of proceedings before taking possession to avoid legal responsibility for maintaining the property.

The rate of foreclosure rose more quickly during the crisis, and stayed higher afterward, in states with lengthy court-supervised foreclosure procedures, Mortgage Bankers Association surveys of loan performance show.

As of late last year, according to association economist Joel Kan, nearly 3 percent of loans were in the foreclosure process in states with court-supervised foreclosure laws, compared to 1 percent for other states.

Richard Simon, of Bank of America, said foreclosure delays are common in a state like New York because of the lengthy process. But, he said, it's never in the bank's financial interest to step back from foreclosure to avoid responsibility for a property.

"Extended foreclosure and property preservation are quite expensive and only add to the large financial losses already being absorbed in most foreclosures," Simon said.

But Peter Skillern, director of Reinvestment Partners, a North Carolina nonprofit that advocates for fairer lending in poor communities, pointed to another possibility. "Sometimes the reality is that these banks have thousands of these houses and they really don't know what to do."