Gut microbes shape many aspects of organismal biology, yet how these key bacteria transmit among hosts in natural populations remains poorly understood. Recent work in mammals has emphasized either transmission through social contacts or indirect transmission through environmental contact, but the relative importance of different routes has not been directly assessed. Here, we used a novel RFID-based tracking system to collect long-term high resolution data on social relationships, space use and microhabitat in a wild population of mice (Apodemus sylvaticus), while regularly characterising their gut microbiota. Through probabilistic modelling of the resulting data, we identify positive and statistically distinct signals of social and environmental transmission, captured by social networks and overlap in home ranges respectively. Strikingly, microbes with distinct biological attributes drove these different transmission signals. While aerotolerant spore-forming bacteria drove the effect of shared space use, a mix of taxa but especially anaerobic bacteria underpinned the social network's effect on gut microbiota similarity. These findings provide the first evidence for parallel social and environmental transmission of gut microbes that involve biologically distinct subsets of the mammalian gut microbiota.