Neurons and glial cells provide guidance cues for migrating neurons. We show here that migrating epithelial cells also contact specific neurons and glia during their pathfinding, and we describe the first gene required in the process. In wild-type Drosophila embryos, the ganglionic tracheal branch navigates a remarkably complex path along specific neural and glial substrata, switching substrata five times before reaching its ultimate target in the CNS. In adrift mutants, ganglionic branches migrate normally along the intersegmental nerve, but sporadically fail to switch to the segmental nerve and enter the CNS; they wind up meandering along the ventral epidermis instead. adrift encodes a novel nuclear protein with an evolutionarily conserved motif. The gene is required in the trachea and is expressed in the leading cells of migrating ganglionic branches where it is induced by the branchless FGF pathway. We propose that Adrift regulates expression of tracheal genes required for pathfinding on the segmental nerve, and FGF induction of adrift expression in migrating tracheal cells promotes the switch from the intersegmental to the segmental nerve.