(g) The lease or a subordination agreement executed by the lessor must provide either:
1. That any lien which encumbers a unit for rent or other moneys or exactions payable is subordinate to any mortgage held by an institutional lender, or
2. That, upon the foreclosure of any mortgage held by an institutional lender or upon delivery of a deed in lieu of foreclosure, the lien for the unit owner's share of the rent or other exactions shall not be extinguished but shall be foreclosed and unenforceable against the mortgagee with respect to that unit's share of the rent and other exactions which mature or become due and payable on or before the date of the final judgment of foreclosure, in the event of foreclosure, or on or before the date of delivery of the deed in lieu of foreclosure. The lien may, however, automatically and by operation of the lease or other instrument, reattach to the unit and secure the payment of the unit's proportionate share of the rent or other exactions coming due subsequent to the date of final decree of foreclosure or the date of delivery of the deed in lieu of foreclosure.
The provisions of this paragraph do not apply if the lessor is the Government of the United States or this state or any political subdivision thereof or any agency of any political subdivision thereof.