Despite the enormous advances in genetics, links between phenotypes and genotypes have been made for only a few nonmodel organisms. However, such links can be essential to understand mechanisms of ecological speciation. The Costa Rican endemic Mangrove Warbler subspecies provides an excellent subject to study differentiation with gene flow, as it is distributed along a strong precipitation gradient on the Pacific coast with no strong geographic barriers to isolate populations. Mangrove Warbler populations could be subject to divergent selection driven by precipitation, which influences soil salinity levels, which in turn influences forest structure and food resources. We used single nucleotide polymorphisms (SNPs) and morphological traits to examine the balance between neutral genetic and phenotypic divergence to determine whether selection has acted on traits and genes with functions related to specific environmental variables. We present evidence showing: (a) associations between environmental variables and SNPs, identifying candidate genes related to bill morphology (BMP) and osmoregulation, (b) absence of population genetic structure in neutrally evolving markers, (c) divergence in bill size across the precipitation gradient, and (d) strong phenotypic differentiation (P ST) which largely exceeds neutral genetic differentiation (F ST) in bill size. Our results indicate an important role for salinity, forest structure, and resource availability in maintaining phenotypic divergence of Mangrove Warblers through natural selection. Our findings add to the growing body of literature identifying the processes involved in phenotypic differentiation along environmental gradients in the face of gene flow.