Tom Bergeron hit a little too close to home Monday night on "Dancing With the Stars" ... when he made a stalking joke about Erin Andrews ... who very famously dealt with a stalker of her own.
Andrews was debriefing Alfonso Ribeiro when she began gushing over Will Smith ... who went on a social media campaign supporting his former "Fresh Prince of Bel Air" co-star.
After Andrews repeatedly invited Will to show up to a taping, Bergeron followed it up by saying Will could do worse than having Erin as a stalker ... insinuating it's ok for hot chicks to stalk guys.
You'll recall ... Erin dealt with a stalker/Peeping Tom who secretly filmed her inside a hotel room and posted a video of her naked online. The creepy peeper was sentenced to 30 months.