Phenotypic variability is a hallmark of human disease. It results from a combination of genetic modifiers, environment, and stochastic effects, but their contributions are hard to disentangle. Here, we establish the specification of terminal cells in the Drosophila tracheal system as a model for phenotypic variability and phenotypic emergence in Mendelian disorders. By perturbing Fibroblast growth factor (FGF) ligand dosage, which leads to a loss of terminal cells, we find that both microenvironmental and stochastic effects contribute to variability in terminal cell specification. We demonstrate that the phenotype results from reduced Ras-ERK signaling and use live imaging to identify molecular and morphological features of successful and failed terminal cell specification. Finally, using liability-threshold modeling, we quantify the relative magnitudes of genetic perturbations, microenvironmental effects, and stochasticity, establishing a strategy for dissecting the origins of phenotypic variability.