Sensory perception modulates health and aging across taxa. Understanding the nature of relevant cues and the mechanisms underlying their action may lead to novel interventions that improve the length and quality of life. We found that in the vinegar fly, Drosophila melanogaster, exposure to dead conspecifics in the environment induced cues that were aversive to other flies, modulated physiology, and impaired longevity. The effects of exposure to dead conspecifics on aversiveness and lifespan required visual and olfactory function in the exposed flies. Furthermore, the sight of dead flies was sufficient to produce aversive cues and to induce changes in the head metabolome. Genetic and pharmacologic attenuation of serotonergic signaling eliminated the effects of exposure on aversiveness and lifespan. Our results indicate that Drosophila have an ability to perceive dead conspecifics in their environment and suggest conserved mechanistic links between neural state, health, and aging; the roots of which might be unearthed using invertebrate model systems.