§ 1307. Duty to maintain foreclosed property. 1. A plaintiff in a mortgage foreclosure action who obtains a judgment of foreclosure and sale pursuant to section thirteen hundred fifty-one of this article, involving residential real property, as defined in section thirteen hundred five of this article, that is vacant, or becomes vacant after the issuance of such judgment, or is abandoned by the mortgagor but occupied by a tenant, as defined under section thirteen hundred five of this article, shall maintain such property until such time as ownership has been transferred through the closing of title in foreclosure, or other disposition, and the deed for such property has been duly recorded; provided, however, that if a municipality or governmental entity holds a mortgage subordinate to one or more mortgages on the residential real property, the municipality or governmental entity shall not be subject to the requirements of this section.
2. Such plaintiff shall have the right to peaceably enter upon such property, or to cause others to peaceably enter upon the property for the limited purpose of inspections, repairs and maintenance as required by this section, or as otherwise ordered by court; provided, however, that if the property is occupied by a tenant, at least seven days notice must be given to such tenant, unless emergency repairs are required in which case reasonable notice shall be provided to the tenant.
3. The municipality in which such residential real property is located, any tenant lawfully in possession, and a board of managers of a condominium in which the premises are located or a homeowners association if said premises are subject to the rules and regulations of such an association, shall have the right to enforce the obligations described in this section in any court of competent jurisdiction after at least seven days notice to the plaintiff in the foreclosure action unless emergency repairs are required. Any entity acting pursuant to this subdivision shall have a cause of action in any court of competent jurisdiction against the plaintiff in the foreclosure action to recover costs incurred as a result of maintaining the property. The authority provided by this subdivision shall be in addition to, and shall not be deemed to diminish or reduce, any rights of the parties described in this section under existing law against the mortgagor of such property for failure to maintain such property.
4. In the event the mortgagor of the property commences a proceeding in bankruptcy court prior to the completion of the public auction ordered in the judgment of sale, the duties created by this section shall be suspended during the pendency of the bankruptcy proceeding or until such time as an order has been entered in that proceeding lifting or removing the automatic stay of the foreclosure sale.
5. For the purposes of this section "maintain" shall mean keeping the subject property in a manner that is consistent with the standards set forth in the New York property maintenance code chapter 3 sections 301, 302 (excluding 302.2, 302.6 and 302.8), 304.1, 304.3, 304.7, 304.10, 304.12, 304.13, 304.15, 304.16, 307.1, and 308.1; provided, however, that if the property is occupied by a tenant, then such property must also be maintained in a safe and habitable condition.
6. A plaintiff shall be relieved of its responsibilities to maintain the residential real property that is the subject of a foreclosure action for the period that a receiver of such property is serving.
7. Nothing contained in this section shall diminish in any way the obligations pursuant to any state or local law of the mortgagor of the property or a receiver of rents and profits appointed in an action to foreclose a mortgage to maintain the property prior to the closing of title pursuant to a foreclosure sale.
8. This section shall not preempt, reduce or limit any rights or obligations imposed by any local laws with respect to property maintenance and the locality's ability to enforce those laws.