This is such a weird question but I thought it was kind of funny to think about.
So, lots of TV shows like to use musical theatre it’s plots but because these shows are copy-written, many of these shows like hire writers to write something similar but not exactly the same. Others are parodies but take inspiration from certain song.I think these are so interesting. Here are a few examples:
Hurt Them First- Dance Moms (Basically identical to Cell Block Tango, like I’m surprised they could get away with these similarities)
One Small Girl- Dance Moms (One Small Girl from Once on This Island. They couldn’t even come up with a different name lol)
Floss- Suite Life Of Zach And Cody (This one doesn’t really count but that’s obviously the joke but I had to include it because of the amount of people I know who’ve listened to Something’s Coming and gone “It’s the song from Zach and Cody!&rdquo
If you have anymore memories of songs like this, please share them with me. I love figuring out what makes them so similar, I love analyzing them.
Family Guy has a TON. "This House is Freakin Sweet" (parody of "I'm Going to Like It Here" from Annie) is one example. There's also "I Need a Jew" which is a parody of "When You Wish Upon a Star" from Pinocchio.
American Dad also has a few. Off of the top of my head, "Mama, Baba" has the direct melody of "Dance: Ten, Looks: Three" from A Chorus Line.
And, of course, Simpsons. "Springfield, Springfield" is a parody of "New York, New York" from On the Town. "See My Vest" Is a parody of "Be My Guest" from Beauty and the Beast. "Adults/Kids" is a parody of "Kids" from Bye, Bye, Birdie. There's also a parody of "I've Grown Accustomed to Her Face" sung by Sideshow Bob.
The Critic has a parody of "New York, New York" from On the Town that's also about NY but more about its negative aspects.
And let's not forget South Park. "Safe Space" has the direct melody of "At the Ballet" From A Chorus Line. South Park: Bigger, Longer, and Uncut the film has a lot too, including "La Resistance Medley" which is pretty much aping "One Day More" from Les Mis. Another Matt and Trey film, Team America, has a RENT parody called Lease which has a song that parodies RENT's finale (although it doesn't sound SUPER similar).
A really recent example would be Documentary! Now's episode about recording the OBCR of a fake musical called Co-op, which is a parody of a documentary about recording the OBCR of Company. A lot of the songs are direct references to songs in the show. For instance, "I Gotta Go" is like "The Ladies Who Lunch."
There are sooo many that it's actually hard to think of them all right now. I also watch a lot of TV though!
Edit: Sorry, I just realized that you were referencing songs that don't have the exact melody line. Some of these still apply though.
Double edit: There are also a lot of songs that parody musicals in general but I can't think of a direct song reference. "I'm Checking In" from the Simpsons, "Dr. Zaius" from the Simpsons, "I've Got a Hunch This is Love" from The Critic," etc .
Jimmy, what are you doing here in the middle of the night? It's almost 9 PM!