Except as provided in section 40-24, no lot existing at the time of passage of the ordinance from which this chapter is derived shall be reduced, divided, or changed so as to produce a tract of land which does not comply with the minimum dimension or area requirements of this chapter for the district in which it is located unless said reduction or division is necessary to provide land that is needed and accepted for public use.