Mammalian species harbor compositionally distinct gut microbial communities, but the mechanisms that maintain specificity of symbionts to host species remain unclear. Here, we show that natural selection within house mice (Mus musculus domesticus) drives deterministic assembly of the house-mouse gut microbiota from mixtures of native and non-native microbiotas. Competing microbiotas from wild-derived lines of house mice and other mouse species (MusandPeromyscusspp.) within germ-free wild-type (WT) andRag1-knockout (Rag1−/−) house mice revealed widespread fitness advantages for native gut bacteria. Native bacterial lineages significantly outcompeted non-native lineages in both WT andRag1−/−mice, indicating home-site advantage for native microbiota independent of host adaptive immunity. However, a minority of native Bacteriodetes and Firmicutes favored by selection in WT hosts were not favored or disfavored inRag1−/−hosts, indicating thatRag1mediates fitness advantages of these strains. This study demonstrates home-site advantage for native gut bacteria, consistent with local adaptation of gut microbiota to their mammalian species.