Closely related tree species that grow in sympatry are abundant in rainforests. However, little is known of the ecoevolutionary processes that govern their niches and local coexistence. We assessed genetic species delimitation in closely related sympatric species belonging to two Neotropical tree species complexes and investi- gated their genomic adaptation to a fine- scale topographic gradient with associated edaphic and hydrologic features. Combining LiDAR- derived topography, tree inven- tories, and single nucleotide polymorphisms (SNPs) from gene capture experiments, we explored genome- wide population genetic structure, covariation of environmen- tal variables, and genotype- environment association to assess microgeographic ad- aptations to topography within the species complexes Symphonia (Clusiaceae), and Eschweilera (Lecythidaceae) with three species per complex and 385 and 257 individu- als genotyped, respectively. Within species complexes, closely related tree species had different realized optima for topographic niches defined through the topographic wetness index or the relative elevation, and species displayed genetic signatures of adaptations to these niches. Symphonia species were genetically differentiated along water and nutrient distribution particularly in genes responding to water depriva- tion, whereas Eschweilera species were genetically differentiated according to soil chemistry. Our results suggest that varied topography represents a powerful driver of processes modulating tropical forest biodiversity with differential adaptations that stabilize local coexistence of closely related tree species.