The city may include within the boundaries of an assessment district created pursuant to this division lands lying within the boundaries of any one or more cities, or counties, when such lands, in the opinion of the legislative body conducting the proceeding, will be benefited by the proposed work if the consent of the legislative body of any territory proposed to be assessed shall first be obtained to the formation of the assessment district and, if any of the proposed work is to be done within such territory, to the work described in the resolution of intention and the assumption of jursidiction thereover for the purposes aforesaid prior to the adoption thereof.