Dietary prebiotics produce favorable changes in the commensal gut microbiome and reduce host vulnerability to stress-induced disruptions in complex behaviors such as sleep. The mechanisms for how prebiotics modulate stress physiology remain unclear; however, emerging evidence suggests that gut microbes and their metabolites may play a role. This study tested if stress and/or dietary prebiotics (Test diet) alter the fecal metabolome; and explored if these changes were related to sleep and/or gut microbial alpha diversity. Male F344 rats on either Test or Control diet were instrumented for electroencephalography biotelemetry measures of sleep/wake. After 5 weeks on diet, rats were either stressed or remained in home cages. Based on untargeted mass spectrometry and 16S rRNA gene sequencing, both stress and Test diet altered the fecal metabolome/microbiome. In addition, Test diet prevented the stress-induced reduction in microbial alpha diversity based on PD_Whole_Tree, which has been previously published. Network propagation analysis revealed that stress increased members of the neuroactive steroidal pregnane molecular family; and that Test diet reduced this effect. We also discovered links between sleep, alpha diversity, and pyrimidine, secondary bile acid, and neuroactive glucocorticoid/pregnanolone-type steroidal metabolites. These results reveal novel microbial-dependent metabolites that may modulate stress physiology and sleep.