In mammals, the environment plays a critical role in promoting the final steps in neuronal development during the early postnatal period. While epigenetic factors are thought to contribute to this process, the underlying molecular mechanisms remain poorly understood. Here, we show that in the brain during early life, the DNA methyltransferase DNMT3A transiently binds across transcribed regions of lowly expressed genes, and its binding specifies the pattern of DNA methylation at CA sequences (mCA) within these genes. We find that DNMT3A occupancy and mCA deposition within the transcribed regions of genes is negatively regulated by gene transcription and may be modified by early-life experience. Once deposited, mCA is bound by the methyl-DNA-binding protein MECP2 and functions in a rheostat-like manner to fine-tune the cell-type-specific transcription of genes that are critical for brain function. The deposition of repressive mCA marks by the methyltransferase DNMT3A across specific brain genes during early postnatal life is important for their regulation throughout life.