Although the molecular composition and architecture of synapses have been widely explored, much less is known about what genetic programs directly activate synaptic gene expression and how they are modulated. Here, using Caenorhabditis elegans dopaminergic neurons, we reveal that EGL-43/MECOM and FOS-1/FOS control an activity-dependent synaptogenesis program. Loss of either factor severely reduces presynaptic protein expression. Both factors bind directly to promoters of synaptic genes and act together with CUT homeobox transcription factors to activate transcription. egl-43 and fos-1 mutually promote each other's expression, and increasing the binding affinity of FOS-1 to the egl-43 locus results in increased presynaptic protein expression and synaptic function. EGL-43 regulates the expression of multiple transcription factors, including activity-regulated factors and developmental factors that define multiple aspects of dopaminergic identity. Together, we describe a robust genetic program underlying activity-regulated synapse formation during development.