The invasive pest Drosophila suzukii has evolved morphological and behavioural adaptations to lay eggs under the skin of fresh fruits. This results in severe damage to a wide range of small fruits. Drosophila suzukii females typically lay few eggs per fruit, preferring healthy fruits. Hence, larvae are exposed to a reduced amount of nitrogenous waste. Differently, the innocuous Drosophila melanogaster lays eggs on fermented fruits already infested by conspecifics, with larvae developing in a crowded environment with the accumulation of nitrogenous waste such as ammonia and urea. These compounds derive from nitrogen metabolism, protein degradation, and amino acids catabolism and are relatively toxic at high concentrations in an organism. The observed differences in oviposition site and larval ecological niche suggest that these species might differ in behavioural and physiological mechanisms used to cope with nitrogenous waste. We investigated how different concentrations of ammonia and urea affect oviposition and larval development in both species. Females and larvae of D. suzukii showed greater susceptibility to high concentrations of both compounds, with a dramatic decrease in the number of eggs laid and egg viability. Moreover, we tested the chemotactic response of third instar larvae to high concentrations of the compounds. Interestingly, ammonia resulted in a repulsive behaviour in respect of the control and urea groups. To better understand the pathways underlying these differences, we evaluated the effect on ornithine aminotransferase and glutathione-S-transferase, two enzymes involved in nitrogen metabolism and stress response that are expressed during larval development. Both ammonia and urea significantly reduced the expression of these enzymes in D. suzukii compared to D. melanogaster. This shows how the ecological shift of D. suzukii to fresh fruit is accompanied by less efficient detoxifying and excretory mechanisms, with important implications for evolutionary biology and applied research. Our data suggest that the ecological shift of D. suzukii to fresh fruit as oviposition substrate is accompanied by a reduced tolerance to metabolic toxins during larval development.