Whenever any real property has been sold for taxes and has been redeemed, the money paid for redemption shall be apportioned and paid to the district treasurer, or deposited in the county treasury for the use of the district, as the case may be, in the proportion which the tax due to the district bears to the total tax for which the property was sold.