Subject to the provisions of any law relating to municipalities, when the necessity for maintaining any fund of the municipality has ceased to exist, and a balance remains in said fund, the certifying board or levying board, as the case may be, shall so declare by resolution, and upon such declaration, such balance shall forthwith be transferred to the fund or funds of the municipality designated by such board, unless other provisions have been made in creating such fund in which such balance remains. In the case of a special fund created by a city or a county under section 403.19, such balance remaining in the fund shall be allocated to and paid into the funds for the respective taxing districts as taxes by or for the taxing district into which all other property taxes are paid.