1) Have you not take NOC from association and transfer certificate from association at that time they must have told you that pending maintenance amount.
2) If any balance is pending of your purchase deed of flat to previous owner. Than you can hold that much amount. Otherwise you can send notice to previous owner to pay to due maintenance.