City and town councils of second-class cities and towns may by a majority vote annex new unincorporated territory outside the city or town limits, whether contiguous or noncontiguous for park, cemetery, or other municipal purposes when such territory is owned by the city or town or all of the owners of the real property in the territory give their written consent to the annexation.