Chronic stress enhances the risk for psychiatric disorders and induces depression and cognitive impairment. Gamma oscillations are essential for neurocircuit function, emotion, and cognition. However, the influence of gamma entrainment by sensory stimuli on specific aspects of chronic stress-induced responses remains unclear. Mice were subjected to corticosterone (CORT) administration and chronic restraint stress (CRS) for weeks, followed by rhythmic gamma frequency light flickering exposure. Local field potentials (LFPs) were recorded from the V1, CA1, and PFC regions to verify the light flicker on gamma oscillations. Behavioral tests were used to examine stress-related and memory-related behaviors. Golgi staining was performed to observe changes in spine morphology. Synaptosomes were isolated to determine the expression of synapse-related proteins through immunoblotting. RNA sequencing (RNA-seq) was applied to explore specific changes in the transcriptome. Immunofluorescence staining, real-time quantitative polymerase chain reaction (qPCR), and ELISA were used to evaluate microglial activation and cytokine levels. In this study, we demonstrated that rhythmic 40 Hz LF attenuated stress-related behavior and cognitive impairments by ameliorating the microstructural alterations in spine morphology and increasing the expression of GluN2A and GluA1 in chronically stressed mice. Transcriptome analysis revealed that significantly downregulated genes in LF-exposed CRS mice were enriched in neuroimmune-related signaling pathways. Rhythmic 40 Hz LF exposure significantly decreased the number of Iba1-positive microglia in the PFC and hippocampus, and the expression levels of the M1 markers of microglia iNOS and CD68 were reduced significantly in CRS mice. In addition, 40 Hz LF exposure suppressed the secretion of cytokines IL-12, which could regulate the production of IFN-γ and IL-10 in stressed mice. Our results demonstrate that exposure to rhythmic 40 Hz LF induces the neuroimmune response and downregulation of neuroinflammation with attenuated stress-related behaviors and cognitive function in CRS-induced mice. Our findings highlight the importance of sensory-evoked gamma entrainment as a potential therapeutic strategy for stress-related disorders treatment. Abbreviations: CORT, Chronic corticosterone treatment; CRS, Chronic restraint stress; IACUC, Institutional Animal Care and Use Committee; LF, light flickers; FST, Forced swim test; NSFT, Novelty-suppressed feeding test; SPT, Sucrose preference test; NSFT, Novelty-suppressed feeding; qPCR, Quantitative real-time polymerase chain reaction; SDS-PAGE, sodium dodecyl sulfate-polyacrylamide gel electrophoresis; PVDF, polyvinylidene fluoride; PBS, phosphate-buffered saline; PBS-T, phosphate-buffered saline plus 0.1% Tween 20; PVDF, polyvinylidene fluoride; GFAP, Glial fibrillary acidic protein; DAPI, 4',6-Diamid- ino-2-phenylindole; Iba1, Ionized calcium-binding adaptor molecule 1; iNOS, Inducible nitric oxide synthase; IL-10, Interleukin-10; IL6, Interleukin 6; IL-1β, Interleukin 1β; IL-12, Interleukin 12; TNF-α, Tumor necrosis factor alpha; IFN-γ, Interferon-gamma; TLR6 and 9, Toll-like Receptor 6 and 9.