Any taxpayer may pay the amount of an assessment into the State treasury, notwithstanding litigation may be pending as to the validity of the whole or any part of said tax, and if it shall be determined in any litigation that the whole or any part of the tax so paid has been unlawfully assessed or imposed, the State Treasurer shall give credit for such overpayment to the taxpayer so paying, upon the taxes next legally levied and payable into the State treasury subsequent to the determination of any such litigation.
N.J.S. § 54:29A-49