The former "Wicked" star performed the song on Tuesday's edition of "The Tonight Show with Jay Leno."
"You will be popular/the right kind of popular," Chenoweth sang. "I'll teach you to zip your fly/ you won't be that guy with a camera down his pants."
The silly song lyrics also included the lines: "They'll think you've become a monk/though they've seen your junk. Now you'll play a different show."
Despite calls for his withdrawal in the wake of the sexting scandal, Weiner has refused to leave the mayoral race even though only 16 percent of primary voters support him.
Weiner last month admitted sending sexually explicit online messages to a younger woman long after the same behavior forced him to leave Congress in 2011.