Alzheimer’s disease (AD) is a neurodegenerative disease characterized by cognitive impairment, with the predominant clinical diagnosis of spatial working memory (SWM) deficiency, which seriously affects the physical and mental health of patients. However, the current pharmacological therapies have unsatisfactory cure rates and other problems, so non-pharmacological physical therapies have gradually received widespread attention. Recently, a novel treatment using 40 Hz light flicker stimulation (40 Hz-LFS) to rescue the cognitive function of model animals with AD has made initial progress, but the neurophysiological mechanism remains unclear. Therefore, this paper will explore the potential neural mechanisms underlying the modulation of SWM by 40 Hz-LFS based on cross-frequency coupling (CFC). Ten adult Wistar rats were first subjected to acute LFS at frequencies of 20, 40, and 60 Hz. The entrainment effect of LFS with different frequency on neural oscillations in the hippocampus (HPC) and medial prefrontal cortex (mPFC) was analyzed. The results showed that acute 40 Hz-LFS was able to develop strong entrainment and significantly modulate the oscillation power of the low-frequency gamma (lγ) rhythms. The rats were then randomly divided into experimental and control groups of 5 rats each for a long-term 40 Hz-LFS (7 d). Their SWM function was assessed by a T-maze task, and the CFC changes in the HPC-mPFC circuit were analyzed by phase-amplitude coupling (PAC). The results showed that the behavioral performance of the experimental group was improved and the PAC of θ-lγ rhythm was enhanced, and the difference was statistically significant. The results of this paper suggested that the long-term 40 Hz-LFS effectively improved SWM function in rats, which may be attributed to its enhanced communication of different rhythmic oscillations in the relevant neural circuits. It is expected that the study in this paper will build a foundation for further research on the mechanism of 40 Hz-LFS to improve cognitive function and promote its clinical application in the future.