This study aims to elucidate the pathways through which Yiyin Anshen Granule (YA) exerts sedative-hypnotic effects in a mouse model of sleep deprivation. DL-4-chlorophenylalanine(PCPA)-treated mice received intragastric administration of YA and pentobarbital sodium-induced sleep tests were conducted on days 7, 14, and 29. The levels of key neurotransmitters, cytokines and receptor protein associated with insomnia were measured using enzyme-linked immunosorbent assay (ELISA) and Western blot. Additionally, 16S ribosomal DNA (rDNA) sequencing was performed to assess the impact of YA on gut microbiota, focusing on species abundance and diversity. YA significantly shortened sleep latency (P < 0.01) and prolonged sleep duration (P < 0.01) in sleep-deprived mice, effectively improving circadian rhythm disturbances compared to the model group (MOD). Biochemical analysis revealed that YA restored abnormal neurotransmitter levels in brain tissue, increasing 5-hydroxytryptamine (5-HT), γ-aminobutyric acid (GABA), and γ-aminobutyric acid type A receptor α-1 subunit (GABAARα1) expression (P < 0.01) and reducing the glutamate (Glu)/GABA ratio (P < 0.01). Additionally, the levels of B-cell lymphoma 2 (BCL-2) and interleukin-6 (IL-6) expression were significantly decreased (P < 0.05, 0.01), while interleukin-1 beta (IL-1β) expression increased (P < 0.01). YA treatment also significantly increased gut microbiota abundance and diversity, with microbiome profiles in the YA group being closer than those of diazepam group (DZP) to the control group (CON). Notably, YA reversed the dysbiosis of high-abundance gut microbiota species associated with insomnia at both the family and genus levels (P < 0.05, 0.01). The results of the present study indicated that YA alleviates insomnia symptoms by regulating neurotransmitter and inflammatory cytokines levels, and restoring gut microbia balance. These mechanisms collectively contribute to shortening sleep latency, prolonging sleep duration, and improving sleep quality in a mouse model of insomnia.