The judgment entered in a foreclosure proceeding under authority of section 2A:50-48 of this title shall be only for the amount of the municipal lien or liens unpaid and paid or purchased by the holder of the mortgage, with interest on the amount of such lien or liens so paid or purchased by the holder of the mortgage from the date of such payment or purchase, and shall adjudge that the mortgage shall be deemed not to have merged therein, but shall remain in full force and effect as security for the principal sum due thereon, with accrued interest.
N.J.S. § 2A:50-47