A city or town in an action by a delinquent taxpayer may assert a counterclaim for any unpaid taxes against any properly authorized payment to which the taxpayer is entitled, provided prior to trial the amount shall have been paid to the tax collector and a receipt in writing shall have been given to the person taxed, as prescribed in Title 36, section 905.
14 M.R.S. § 5901