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 C.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 1. The embryonically generated DD MNs initially innervate ventral muscles in the first (L1) larval stage and receive their synaptic input from cholinergic MNs in the dorsal cord. They rewire by the end of the L1 molt to innervate dorsal muscles and to be innervated by newly formed ventral cholinergic MNs 1. VD MNs develop after the L1 molt; they take over the innervation of ventral muscles and receive their synaptic input from dorsal cholinergic MNs. 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 MNs 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 MNs in a temporally controlled manner and is required for appropriate selection of both pre- and post-synaptic partners.