The New Jersey Senate has passed a bill that would allow cities to establish charitable funds to accept property taxes so homeowners could get around a new federal law by declaring them deductible charitable contributions.

The new federal tax law caps the deduction for all state and local income, property and other taxes at $10,000, which is well below the level that many property owners pay in high-tax states like New Jersey. The deduction was previously unlimited.

State officials have been debating since the federal tax law was passed in December about how to help their taxpayers not get dinged with bigger federal tax bills that will fall heaviest on certain states.

New Jersey’s Senate passed the measure, S1893, on a 28-9 vote Monday. It would allow municipalities to set up charitable funds for taxes. Local governments could give tax credits to residents who contribute to the fund, allowing them to offset almost all of their property tax bill — likely around 90 percent. Then residents would take a charity write-off for their property taxes on their federal income taxes.

The New Jersey bill’s sponsor, Sen. Paul Sarlo (D-Bergen), called it a “short-term measure to deal with how New Jersey taxpayers got their teeth kicked in” by Congress, the New Jersey Advance reported.

“Congress made the decision to favor some states over others,” Sarlo said at the hearing for the bill. “The net effect is the so-called Tax Cuts and Jobs Act actually raises taxes for states like New Jersey.”

The state Assembly must pass the bill for it to become law. Democratic Gov. Phil Murphy has said he supports the measure. Murphy has called the federal tax law a “gut punch” to the middle class of his state.

Some lawmakers railed against the law, saying the Internal Revenue Service would never accept it. It’s uncertain that such a law would withstand a legal challenge by the IRS.

But if New Jersey and other states succeed with their federal tax workaround plans, the federal government could lose billions of dollars expected to come into the treasury from capping state deductions.

Treasury Secretary Steven Mnuchin last month called state plans for property tax charitable deductions “ridiculous” and said he hoped states spend more time on cutting their budgets and taxes instead of trying to dodge the new federal law.