In plant communities, diversity often increases productivity and functioning, but the specific underlying drivers are difficult to identify. Most ecological theories attribute positive diversity effects to complementary niches occupied by different species or genotypes. However, the specific nature of niche complementarity often remains unclear, including how it is expressed in terms of trait differences between plants. Here, we use a gene-centred approach to study positive diversity effects in mixtures of natural Arabidopsis thaliana genotypes. Using two orthogonal genetic mapping approaches, we find that between-plant allelic differences at the AtSUC8 locus are strongly associated with mixture overyielding. AtSUC8 encodes a proton-sucrose symporter and is expressed in root tissues. Genetic variation in AtSUC8 affects the biochemical activities of protein variants and natural variation at this locus is associated with different sensitivities of root growth to changes in substrate pH. We thus speculate that - in the particular case studied here - evolutionary divergence along an edaphic gradient resulted in the niche complementarity between genotypes that now drives overyielding in mixtures. Identifying genes important for ecosystem functioning may ultimately allow linking ecological processes to evolutionary drivers, help identify traits underlying positive diversity effects, and facilitate the development of high-performance crop variety mixtures.