Although epigenetic control of stem cell fate choice is well established, little is known about epigenetic regulation of terminal neuronal differentiation. We found that some differences among the subtypes of Caenorhabditis elegans VC neurons, particularly the expression of the transcription factor gene unc-4, require histone modification, most likely H3K9 methylation. An EGF signal from the vulva alleviated the epigenetic repression of unc-4 in vulval VC neurons but not the more distant nonvulval VC cells, which kept unc-4 silenced. Loss of the H3K9 methyltransferase MET-2 or H3K9me2/3 binding proteins HPL-2 and LIN-61 or a novel chromodomain protein CEC-3 caused ectopic unc-4 expression in all VC neurons. Downstream of the EGF signaling in vulval VC neurons, the transcription factor LIN-11 and histone demethylases removed the suppressive histone marks and derepressed unc-4. Behaviorally, expression of UNC-4 in all the VC neurons caused an imbalance in the egg-laying circuit. Thus, epigenetic mechanisms help establish subtype-specific gene expression, which are needed for optimal activity of a neural circuit.