LIM homeodomain codes regulate the development of many cell types, though it is poorly understood how these factors control gene expression in a cell-specific manner. Lhx3 is involved in the generation of two adjacent, but distinct, cell types for locomotion, motor neurons and V2 interneurons. Using in vivo function and protein interaction assays, we found that Lhx3 binds directly to the LIM cofactor NLI to trigger V2 interneuron differentiation. In motor neurons, however, Isl1 is available to compete for binding to NLI, displacing Lhx3 to a high-affinity binding site on the C-terminal region of Isl1 and thereby transforming Lhx3 from an interneuron-promoting factor to a motor neuron-promoting factor. This switching mechanism enables specific LIM complexes to form in each cell type and ensures that neuronal fates are tightly segregated.