In Caenorhabditis elegans, VA and VB motor neurons arise as lineal sisters but synapse with different interneurons to regulate locomotion. VA-specific inputs are defined by the UNC-4 homeoprotein and its transcriptional corepressor, UNC-37/Groucho, which function in the VAs to block the creation of chemical synapses and gap junctions with interneurons normally reserved for VBs. To reveal downstream genes that control this choice, we have employed a cell-specific microarray strategy that has now identified unc-4-regulated transcripts. One of these genes, ceh-12, a member of the HB9 family of homeoproteins, is normally restricted to VBs. We show that expression of CEH-12/HB9 in VA motor neurons in unc-4 mutants imposes VB-type inputs. Thus, this work reveals a developmental switch in which motor neuron input is defined by differential expression of transcription factors that select alternative presynaptic partners. The conservation of UNC-4, HB9, and Groucho expression in the vertebrate motor circuit argues that similar mechanisms may regulate synaptic specificity in the spinal cord.