Understanding differences in life-history outcomes under variable abiotic conditions is essential for understanding species coexistence. At middle elevations, a mosaic of available sets of abiotic conditions could allow highland and lowland species of the same ecological guild to overlap. Therefore, these sites are excellent to study the influence of abiotic conditions on life history and, thus, spatial overlap patterns of competing species. To test differences in life-history outcomes, we selected a pair of closely related lacertids, Iberolacerta horvathi and Podarcis muralis, with an overlapping geographical range but a contrasting elevational distribution. To assess how abiotic and biotic factors contribute to the realized niches of both species, we first built dynamic energy budget (DEB) models for each species based on available functional and life-history data. Then, we used a mechanistic modelling framework (NicheMapR) to simulate the microclimatic conditions at 15 study sites across an elevational gradient and performed whole life-cycle simulations for both species to compare egg development times, lifespans, reproductive years, mean yearly basking and foraging times and yearly fecundity in syntopy and allotopy along the elevational gradient. Our simulations show that the variability of abiotic conditions along an elevational gradient affects life-history traits of both species. We found strong effects of species and elevation on life-history outcomes such as longevity, activity and fecundity. We also observed the effects of syntopy/allotopy on egg development times, activity and reproductive output. In addition, we found a significant interplay between elevation and species impacting fecundity where occupying higher elevation habitats resulted in a more pronounced reduction in fecundity in P. muralis. Furthermore, using two different thermal preferences for spring and summer, we show that some physiological and reproductive traits change with seasonal changes in thermal preferences. Based on our simulations, we conclude that the intermediate elevations that harbour the majority of syntopic populations exhibit high environmental variability that is likely facilitating species coexistence. Since our model predictions support that the current elevational distribution of the species is not only affected by abiotic factors, this suggests that past historical contingencies might have also played a significant role. Our study provides a framework using mechanistic models to understand current distribution patterns of two interacting species by comparing life-history differences between species based on responses to changing abiotic conditions along an elevation gradient.