The use of both the costume and vanilla version of a hero in the same team counts as two unique heroes of that family and DOES count towards the family bonus.
Worth doing a search if in doubt, or just click on the link to save time.
Costume Family Bonus
From Sept '21 @PlayForFun’s Beta Beat regarding HotM costumes, there are more but the mechanic is the same.