We investigate the impact of exposure to an economically deprived neighborhood in Denmark on outcomes related to mental health. To identify the effect, we exploit the quasi-random assignment of applicants to diverse neighborhoods by the Copenhagen municipality from 2000 to 2007. Using data on the assignment combined with longitudinal administrative data, we find that exposure to an economically deprived neighborhood significantly increases the probability of being treated with psychiatric medication by 3.6 percentage points. A significant negative impact on mental health occurs among men and non-Western immigrants, and the results indicate that the effect of neighborhood deprivation on mental health is cumulative. We find that the negative impact of neighborhood deprivation comes from the most deprived neighborhoods. Our results suggest that for vulnerable populations, exposure to deprived neighborhoods affects mental health through social interactions with their new neighbors.