The increase in availability of whole genome sequences makes it possible to search for evidence of adaptation at an unprecedented scale. Despite recent progress, our understanding of the adaptive process is still very limited due to the difficulties in linking adaptive mutations to their phenotypic effects. In this study, we integrated different levels of biological information to pinpoint the ecologically relevant fitness effects and the underlying molecular and biochemical mechanisms of a putatively adaptive TE insertion in Drosophila melanogaster: the pogo transposon FBti0019627. We showed that other than being incorporated into Kmn1 transcript, FBti0019627 insertion also affects the polyadenylation signal choice of CG11699 gene. Consequently, only the short 3'UTR transcript of CG11699 gene is produced and the expression level of this gene is higher in flies with the insertion. Our results indicated that increased CG11699 expression leads to xenobiotic stress resistance through increased ALDH-III activity: flies with FBti0019627 insertion showed increased survival rate in response to benzaldehyde, a natural xenobiotic, and to carbofuran, a synthetic insecticide. Although differences in survival rate between flies with and without the insertion were not always significant, when they were, they were consistent with FBti0019627 mediating resistance to xenobiotics. Taken together, our results provide a plausible explanation for the increase in frequency of FBti0019627 in natural populations of D. melanogaster and add to the limited number of examples in which a natural genetic mutation has been linked to its ecologically relevant phenotype. Furthermore, the widespread distribution of TEs across the tree of life and conservation of stress response pathways across organisms make our results relevant not only for Drosophila, but for other organisms as well.