We investigated differences in brain activity in response to sleep-related pictures between chronic insomnia disorder (CID) patients and good sleepers (GS), and examined whether brain activity moderated the relationship between depressive symptoms and sleep disturbance in CID patients and GS. This study included 43 patients diagnosed with CID, based on the International Classification of Sleep Disorders-3, and 42 GS. The participants kept a sleep diary, underwent nocturnal polysomnography to measure sleep parameters, and completed self-report questionnaires to assess sleep and psychiatric symptoms. They underwent functional magnetic resonance imaging (fMRI) to examine differences in brain activity in response to sleep-related pictures compared to neutral pictures. A moderated moderation analysis was performed to investigate the moderating role of brain responses to sleep-related pictures in the association between depressive symptoms and sleep disturbance. Compared to GS, the brain responses to sleep-related stimuli were significantly lower in CID patients in the right lateral prefrontal cortex (LPFC) and dorsomedial prefrontal cortex (DMPFC). More severe depressive symptoms were significantly associated with longer sleep latency only when LPFC activity was low in CID patients, but not in GS. LPFC hypoactivity in response to sleep-related stimuli in CID patients could moderate the relationship between depression and sleep disturbance.