If, in an action for the enforcement against real estate of a claim for the payment of money, except for the foreclosure of a mortgage, as to which a notice of lis pendens has been filed, the defendant therein gives such sufficient security as the court having jurisdiction of the action shall direct, to pay such sum of money as may, by the final determination of the action, be ascertained to be chargeable upon the affected real estate, the court may by order discharge the real estate from such claim.
N.J.S. § 2A:15-15