Barth, who opened up about her 2011 encounter with Weinstein to the New Yorker, had informed MacFarlane about the incident.
"Congratulations, you five ladies no longer have to pretend to be attracted to Harvey Weinstein," MacFarlane had said alongside Emma Stone while announcing the nominations for the best supporting actresses category.
MacFarlane said the jibe was intended to shame Weinstein and came from "a place of loathing and anger".
"In 2011, my friend and colleague Jessica Barth, with whom I worked on the Ted films, confided in me regarding her encounter with Harvey Weinstein and his attempted advances," MacFarlane tweeted.
More From This Section
MacFarlane applauded his friend for finally sharing her story in public.
"There is nothing more abhorrent and indefensible than abuse of power such as this. I respect and applaud my friend Jessica and those sharing their stories for their decision to come forward, and for being champions of the truth."
The actor joins a growing list of celebrities such as Meryl Streep, Judi Dench, Bob Iger, George Clooney, Jennifer Lawrence, James Gunn, Leonardo DiCaprio, Julianne Moore, Seth Rogen, Lena Dunham, Judd Apatow, John Oliver, Patricia Arquette and Mark Ruffalo, who have spoken out against Weinstein after details of his alleged sexual assault claims were published in a New York Times article.