Liberal Newark Mayor Ras Baraka is taking a page from President Trump’s book — by building a virtual wall between the city and Big Apple homeless shelters.

The City Council passed legislation introduced by Baraka on Monday that would effectively ban New York City from sending its homeless there under the current state of Mayor Bill de Blasio’s controversial “Special One-Time Assistance” program.

The move follows an October Post report revealing 5,074 homeless families have relocated to 373 cities with a full year of taxpayer-covered rent since the program’s August 2017 inception, according to Department of Homeless Services data obtained by The Post.

Newark has taken in more families than any other city: 1,198 as of Aug. 31.

The program has come under fire from SOTA benefactors who say they’ve been placed in uninhabitable apartments where landlords have little incentive to maintain them — because the New York City has already paid them for a full year upfront.

Leaders in communities where New York City homeless have been sent also complained that city officials haven’t alerted them to the influx.

“The folks who run this program in New York and any others like it, have taken advantage of these families they sent to the city of Newark,” Newark legal counsel Kenyatta Stewart said. “They refuse to provide the information needed so that we can ensure that the families that are here are not living in substandard conditions. We will not sit back as they attempt to take advantage of us and milk our taxpayers of the funds spent to support Newarkers.”

Jarvis Cureton and his family were abandoned in a SOTA-sponsored Newark apartment that was infested with roaches and mice, he told CBS2 earlier this month.

Newark hopes to prevent similar situations by prohibiting landlords from accepting public vouchers that cover more than a month of rent.

Tenants must provide written confirmation each month that the conditions are habitable before the funds are released, according to the new Newark law.

The legislation also strengthens pre-move-in inspection requirements — so unwitting SOTA participants like Cureton aren’t blindsided by shoddy conditions on move-in day.

Once the modified Housing Code takes effect on Dec. 14, landlords who accept 12-month publicly assisted rental payments or fail to meet inspection requirements will be fined $250.

Baraka declined to comment. He previously said SOTA “has serious defects and is causing a burden on the city of Newark and program participants.

“The individuals that come here under the SOTA program often land in uninhabitable and illegally converted apartments, which does nothing to break the homelessness cycle, and benefits negligent landlords,” Baraka said.

DHS spokesman Isaac McGinn said, “We of course share Newark’s concern about unscrupulous landlords, and we have strengthened our programs to protect those we serve. We look forward to working with Newark on these issues.”