Of course you are liable for the rent. If you are battling an issue in court, the legally responsible thing to do is to keep all rents originally owed in a bank account while sorting things out on court. The idea behind court is not to get a bonanza. We all have tj Kay to live.
If the court in favor of the tenant, the landlord can be ordered to pay for the court costs as well as the attorneys fee for the tenant. It is not stated if the tenant has to pay the rent for that period or not since it depends on the rental agreement with the attorney representing the case. You can go to the department of consumer affairs website on eviction process for more information.