The defendant may set up by way of answer any defense which it may have to the collection of such taxes. If the defendant claims the tax to be void, the court must in the action ascertain the just amount of the taxes due for the year it is claimed the taxes are delinquent, and if, in its opinion, the assessment or any subsequent proceeding has been rendered void or voidable by the omission or commission of any act required or prohibited, the court shall order it reassessed by the Department of Revenue, and shall thereupon render judgment for the just amount of taxes due from the defendant for that year or years.
SDCL 10-38-13