Understanding the influence of environmental variation on the relationship between biodiversity and ecosystem functioning is of theoretical and practical interest. We predicted that the strength of this relationship should increase with available biotope space (the physical space associated with a species’ niche) due to increased niche complementarity between species. In this study, biotope space specifically refers to soil volume which is associated with the niche dimension of nutrient acquisition. We tested our prediction by growing plant communities on a gradient of increasing soil depth and volume, offering increased rooting space to species. Our results provide support for a linear increase of the magnitude of positive biodiversity effects on above- and belowground community biomass with increasing biotope space. This increase was caused by complementarity effects between species. Soil erosion may thus reduce intercropping benefits.