You and I have different definitions of dangerous. Risky might be a better word. But the right word for that sentence is probably "unpleasant" or "vexing". Dangerous is getting your hand caught in your disposal. Not being able to talk to a neighbor is like getting a piece of food caught in your disposal.
I'd say it's more dangerous to not know your neighbors. If you're ever in trouble in your neighborhood (where you might logically spend a lot of your time) you can rely upon them. If they don't know you, they might be less willing to help in a situation involving actual danger.
If you live in apartment complex and you and a neighbor get on bad terms, he can give noise complaints up the wazoo (not the obvious 'he was partying all night' but 'a few loud noises woke me up at 2am /unprovable types of claims) about you, get you evicted and you have a much more difficult time finding a new place to live in.
I'd say it's more dangerous to not know your neighbors. If you're ever in trouble in your neighborhood (where you might logically spend a lot of your time) you can rely upon them. If they don't know you, they might be less willing to help in a situation involving actual danger.