The Association Fallacy, also known as Guilt by Association, is an informal fallacy that is committed when a person, belief or group is attacked or defended on the basis that it has something in common with a positively/negatively viewed person, belief or group. It is, to an extent, a form of non sequitur.
This fallacy can be used in a positive or negative (derogatory) context. In both cases, it is equally fallacious. This is best demonstrated by common examples.
https://rationalwiki.org/wiki/Association_fallacy