He can support his mate without joining him in any planned retaliation. Why was he beaten up, anyway? Was it entirely unprovoked, or the result of a difference of opinion? Could his friend avoid the gang in future, or is he intending a showdown? He and your son are in danger of becoming part of the neighbourhood gang warfare if they are considering a tit-for-tat.
I hope you blew up too when he told you that you were a useless etc. That is no way to talk to his mother, and if you take it once you will continue to take it. It is one thing to be all "teenage moody" but he could stay reasonably polite. Abusing his mother is no way to react to his friend's problems.
Seventeen is old enough to see things from someone else's point of view. I understand him wanting to help his mate - and I am sure you do as well - but does he understand that violence can be turned onto his family if he gets involved, and that you have had enough of violence and aggression from your ex-neighbour?
Is he aware of everything you have had to put up with there, and of how helpless an older person (one who is not in the full strength of their young manhood, as he is) can feel when confronted by aggression? If he is not, then tell him, and ask whether he would feel happy to have his mother in fear of being beaten up as well.