This quantitative study investigates the complex interactions that exist between neighborhood features, children's and adolescents' mental health, and socioeconomic status (SES) in underprivileged urban neighborhoods in West Java. 340 individuals in a broad sample offered insights into neighborhood characteristics, SES indicators, demographic variances, and mental health outcomes. The results highlight the critical role that economic differences play by revealing a strong negative connection between SES and mental health. Furthermore, neighborhood features—in particular, social cohesiveness and safety perceptions—have been shown to have a significant impact on mental health outcomes. These neighborhood characteristics, according to mediation analyses, moderate the association between SES and mental health, providing detailed insights into the underlying mechanisms. The results help provide a more comprehensive picture of young people's mental health in urban environments, which helps shape targeted treatments and policies for vulnerable groups.