Sex steroids, derived mainly from gonads, can shape microbiota composition; however, the impact of gonadectomy and sex on steroid production in the gut (i.e., gut steroids), and its interaction with microbiota composition, needs to be clarified. In this study, steroid environment and gut steroidogenesis were analysed by liquid chromatography tandem mass spectrometry and expression analyses. Gut microbiota composition as branched- and short-chain fatty acids were determined by 16S rRNA gene sequence analysis and gas chromatography flame ionisation detection, respectively. Here, we first demonstrated that levels of pregnenolone (PREG), progesterone (PROG), and isoallopregnanolone (ISOALLO) were higher in the female rat colon, whereas the level of testosterone (T) was higher in males. Sexual dimorphism on gut steroidogenesis is also reported after gonadectomy. Sex, and more significantly, gonadectomy, affects microbiota composition. We noted that a number of taxa and inferred metabolic pathways were associated with gut steroids, such as positive associations between Blautia with T, dihydroprogesterone (DHP), and allopregnanolone (ALLO), whereas negative associations were noted between Roseburia and T, ALLO, PREG, ISOALLO, DHP, and PROG. In conclusion, this study highlights the novel sex-specific association between microbiota and gut steroids with possible relevance for the gut-brain axis.