Damn-by-association Definition

verb

To discredit or condemn (someone or something, such as a position) by attacking someone or something associated.

Wiktionary