Shank2 is an excitatory postsynaptic scaffolding protein strongly implicated in autism spectrum disorders (ASDs). Shank2-mutant mice with a homozygous deletion of exons 6 and 7 (Shank2-KO mice) show decreased NMDA receptor (NMDAR) function and autistic-like behaviors at juvenile [∼postnatal day (P21)] and adult (>P56) stages that are rescued by NMDAR activation. However, at ∼P14, these mice show the opposite change – increased NMDAR function; moreover, suppression of NMDAR activity with early, chronic memantine treatment during P7–21 prevents NMDAR hypofunction and autistic-like behaviors at later (∼P21 and >P56) stages. To better understand the mechanisms underlying this rescue, we performed RNA-Seq gene-set enrichment analysis of forebrain transcriptomes from wild-type (WT) and Shank2-KO juvenile (P25) mice treated early and chronically (P7–21) with vehicle or memantine. Vehicle-treated Shank2-KO mice showed upregulation of synapse-related genes and downregulation of ribosome- and mitochondria-related genes compared with vehicle-treated WT mice. They also showed a transcriptomic pattern largely opposite that observed in ASD (reverse-ASD pattern), based on ASD-related/risk genes and cell-type–specific genes. In memantine-treated Shank2-KO mice, chromatin-related genes were upregulated; mitochondria, extracellular matrix (ECM), and actin-related genes were downregulated; and the reverse-ASD pattern was weakened compared with that in vehicle-treated Shank2-KO mice. In WT mice, memantine treatment, which does not alter NMDAR function, upregulated synaptic genes and downregulated ECM genes; memantine-treated WT mice also exhibited a reverse-ASD pattern. Therefore, early chronic treatment of Shank2-KO mice with memantine alters expression of chromatin, mitochondria, ECM, actin, and ASD-related genes.