Synapse formation is a process tightly controlled in space and time. How gene regulatory mechanisms specify spatial and temporal aspects of synapse formation is not well understood. In the nematode Caenorhabditis elegans, two subtypes of the D-type inhibitory motor neuron (MN) classes, the dorsal D (DD) and ventral D (VD) neurons, extend axons along both the dorsal and ventral nerve cords. The embryonically generated DD motor neurons initially innervate ventral muscles in the first (L1) larval stage and receive their synaptic input from cholinergic motor neurons in the dorsal cord. They rewire by the end of the L1 moult to innervate dorsal muscles and to be innervated by newly formed ventral cholinergic motor neurons. VD motor neurons develop after the L1 moult; they take over the innervation of ventral muscles and receive their synaptic input from dorsal cholinergic motor neurons. We show here that the spatiotemporal control of synaptic wiring of the D-type neurons is controlled by an intersectional transcriptional strategy in which the UNC-30 Pitx-type homeodomain transcription factor acts together, in embryonic and early larval stages, with the temporally controlled LIN-14 transcription factor to prevent premature synapse rewiring of the DD motor neurons and, together with the UNC-55 nuclear hormone receptor, to prevent aberrant VD synaptic wiring in later larval and adult stages. A key effector of this intersectional transcription factor combination is a novel synaptic organizer molecule, the single immunoglobulin domain protein OIG-1. OIG-1 is perisynaptically localized along the synaptic outputs of the D-type motor neurons in a temporally controlled manner and is required for appropriate selection of both pre- and post-synaptic partners.