Ecological speciation involves the evolution of reproductive isolation and niche divergence in the absence of a physical barrier to gene flow. The process is one of the most controversial topics of the speciation debate, particularly in tropical regions. Here, we investigate ecologically based divergence across an Amazonian ecotone in the electric fish, Steatogenys elegans. We combine phylogenetics, genome scans, and population genetics with a recently developed individual-based evolutionary landscape genetics approach that incorporates selection. This framework is used to assess the relative contributions of geography and divergent natural selection between environments as biodiversity drivers. We report on two closely related and sympatric lineages that exemplify how divergent selection across a major Amazonian aquatic ecotone (i.e., between rivers with markedly different hydrochemical properties) may result in replicated ecologically mediated speciation. The results link selection across an ecological gradient with reproductive isolation and we propose that assortative mating based on water color may be driving the divergence. Divergence resulting from ecologically driven selection highlights the importance of considering environmental heterogeneity in studies of speciation in tropical regions. Furthermore, we show that framing ecological speciation in a spatially explicit evolutionary landscape genetics framework provides an important first step in exploring a wide range of the potential effects of spatial dependence in natural selection.