I began subletting a room in NYC/Brooklyn on July 1, 2019. She asked me to pay first month's rent, last month's rent and security deposit (per June 2019, I believe NYC rent law made it illegal to even ask for last month's rent). I have paid my rent timely, responsibly every month and have records of this.
Prime tenant did not at any time and point bill me for any utility bills since July 1, 2019. My sublease agreement did mention I would be responsible to pay 1/3 of utility bills, but she never actually billed me for them. Utilities come to her, under her name as she's on the lease (landlord).
Due to the pandemic and my job loss, I asked the prime tenant to please defer the rent for May 2020; she refused. She asked me to give me 30 days' notice (essentially eviction) and she'd apply the last month's rent (which she received upon signing the sublease agreement) to May 2020 and vacate the premises by June 1, 2020.
She then told me she will return the remainder of the security deposit after she deducts utilities from my security deposit. Is it legal for her not to bill me the entire time I lived there, then retroactively charge me for utilities through deducting it from the security deposit? It was her responsibility to bill me properly each month, she did not in any form. Now she wants to deduct it from my security deposit. It was my understanding security deposit is there for damages incurred and the cost of repairment.