We examined the relationship between economic, physical, and social characteristics of neighborhoods, where men who have sex with men (MSM) lived and socialized, and symptom scores of depression and generalized anxiety disorder (GAD). Participants came from a cross-sectional study of a population-based sample of New York City MSM recruited in 2010-2012 (n = 1126). Archival and survey-based data were obtained on neighborhoods, where the men lived and where they socialized most often. MSM who socialized in neighborhoods with more economic deprivation and greater general neighborhood attachment experienced higher GAD symptoms. The relationship between general attachment to neighborhoods where MSM socialized and mental health depended on the level of gay community attachment: in neighborhoods characterized by greater gay community attachment, general neighborhood attachment was negatively associated with GAD symptoms, while in low gay community attachment neighborhoods, general neighborhood attachment had a positive association with GAD symptoms. This study illustrates the downsides of having deep ties to social neighborhoods when they occur in the absence of broader access to ties with the community of one's sexual identity. Interventions that help MSM cross the spatial boundaries of their social neighborhoods and promote integration of MSM into the broader gay community may contribute to the reduction of elevated rates of depression and anxiety in this population.