As an alternative to any procedure prescribed by law for the division of taxes or assessments collected in a district lying partially or wholly in territory annexed by an incorporated city, the city and the district may enter into an agreement providing that the district shall continue to perform services for the annexed territory until the close of the fiscal year for which the district has levied taxes or assessments.