Is that why life in New York city is so much nicer place to live than average mid sized middle American town?
I wouldn't say NY is a nicer place to live than say Denver or Sante Fe.
But it does have a lot more people packed in tight. Coincidence?
I have pals who could live anywhere who prefer NYC. There are lots of people with preferences like that. To them, NYC goes through waves of better and worse, depending on who runs the place and their policies, not depending on density fluctuations.
Manhattan (to choose a defined area) peak population was in 1910 (2.3M). Its population as gone up and down. Today is 1.7M. What was its best decade? 1960's had 1.7M. 1870's had 1M people.
Tokyo, Taipei, Singapore are high density but safe.
Density is pretty high in some old European towns that people think have good quality of life (ones built up a hill, or crammed into a little valley).
In college, I lived in a dorm of 1300 people packed in. It was a blast. And safe. It was sort of like living on a space ship. But I wouldn't want to live in a 1300 person favela in Brasil.
I don't think density is the main determiner of quality of life for a locale.