Where real property has been sold pursuant to a judgment in an action to foreclose a mortgage, and an action is thereafter brought to foreclose or extinguish a right of redemption in such real property, the judgment, instead of directing a sale of the property, shall fix the right of any person having a right of redemption therein or the right to foreclose a subordinate mortgage or other lien and shall provide that a failure to redeem or commence an action for the foreclosure of such mortgage or other lien within such time shall preclude such person having a right of redemption or the holder of such mortgage or other lien from redeeming such property or foreclosing such mortgage or other lien, and thereafter such person having a right of redemption or the holder of such mortgage or other lien shall be excluded from claiming any title or interest in such property and all title or interests of such person having a right of redemption in, or the right to foreclose a subordinate mortgage or other lien against such property shall thereby be extinguished and terminated.
N.Y. Real Prop. Acts. Law § 1352