Insomnia is associated with neurotransmitters and intestinal dysbiosis. Though studies have demonstrated the ameliorative effects of milk hydrolysates on insomnia, the underlying mechanisms require further exploration. In this study, we investigated how papain hydrolysates of goat casein (CPH) and whey protein (WPH) affected mice's sleeplessness. Here, we show that CPH effectively improved the total sleep time in 12 h and restoring neurotransmitters (5-hydroxytryptamine (5-HT), γ-aminobutyric acid (GABA), dopamine (DA), and norepinephrine (NE)) in mice. Further gut microbiota analysis revealed a significant increase in the relative abundance of Helicobacter and Escherichia-Shigella and a decrease in the relative abundance of Lactobacillus in the insomnia model mice (Model). Compared to the Model group, both CPH and WPH significantly increased the relative abundance of Akkermansia and Lactobacillus while lowering the relative abundance of Helicobacter and Escherichia-Shigella. Notably, while diazepam (DZP) increased mouse sleep duration, it also increased the relative abundance of Colidextribacter, Parasutterella, Muribaculaceae, and Prevotella. Additionally, the gene expression and protein expression of GABAA receptor, cAMP-response element binding protein (CREB), and brain-derived neurotrophic factor (BDNF) were upregulated in the hypothalamus. We also discovered a link between intestinal gut microbiota and neurotransmitters. Overall, our results suggest that goat milk hydrolysates, especially CPH, can effectively improve insomnia, providing a theoretical basis for further experimentation and individualized designs.