Understanding the ecological processes that generate complex community structures may provide insight into the establishment and maintenance of a normal microbial community in the human gastrointestinal tract, yet very little is known about how biotic interactions influence community dynamics in this system. Here, we use natural strains of Escherichia coli and a simplified model microbiota to demonstrate that the colonization process on the strain level can be context dependent, in the sense that the outcome of intra-specific competition may be determined by the composition of the background community. These results are consistent with previous models for competition between organisms where one competitor has adapted to low resource environments whereas the other is optimized for rapid reproduction when resources are abundant. The genomic profiles of E. coli strains representing these differing ecological strategies provide clues for deciphering the genetic underpinnings of niche adaptation within a single species. Our findings extend the role of ecological theory in understanding microbial systems and the conceptual toolbox for describing microbial community dynamics. There are few, if any, concrete examples of context-dependent competition on a single trophic level. However, this phenomenon can have potentially dramatic effects on which bacteria will successfully establish and persist in the gastrointestinal system, and the principle should be equally applicable to other microbial ecosystems.