The gut-brain axis is a critical communication system influencing the interactions between the gastrointestinal tract (GI) and the central nervous system (CNS). The gut microbiota plays a significant role in this axis, affecting the development and function of the nervous system. Stress-induced psychopathologies, such as depression and anxiety, have been linked to the gut microbiota, but underlying mechanisms and genetic susceptibility remain unclear. In this study, we examined stress-induced changes in the gut microbiome composition in two rat strains with different levels of nervous system excitability: high threshold (HT strain) and low threshold (LT strain). Rats were exposed to long-term emotional and painful stress using the Hecht protocol, and fecal samples were collected at multiple time points before and after stress exposure. Using 16S rRNA amplicon sequencing, we assessed the qualitative and quantitative changes in the gut microbiota. Our results revealed distinct microbial diversity between the two rat strains, with the HT strain displaying higher diversity compared to the LT strain. Notably, under prolonged stress, the HT strain showed an increase in relative abundance of microorganisms from the genera Faecalibacterium and Prevotella in fecal samples. Additionally, both strains exhibited a decrease in Lactobacillus abundance following stress exposure. Our findings provide valuable insights into the impact of hereditary nervous system excitability on the gut microbiome composition under stress conditions. Understanding the gut-brain interactions in response to stress may open new avenues for comprehending stress-related psychopathologies and developing potential therapeutic interventions targeted at the gut microbiota. However, further research is needed to elucidate the exact mechanisms underlying these changes and their implications for stress-induced disorders. Overall, this study contributes to the growing body of knowledge on the gut-brain axis and its significance in stress-related neurobiology.