Madonna has Jennifer Grey’s love life to thank for "Express Yourself."

In 1986, the "Dirty Dancing" star was dating Matthew Broderick, whom she met on the set of "Ferris Bueller’s Day Off." The two became engaged at one point. But after four years, the couple called it quits.

And it was during that time that Grey became pals with the Material Girl.

"We did ‘Bloodhounds of Broadway’ together," the "Dirty Dancing" star told People magazine on Friday about their 1989 film.

‘DIRTY DANCING’ STAR JENNIFER GREY SAYS SHE BECAME ‘INVISIBLE’ AFTER SECOND NOSE JOB: ‘I WAS NO LONGER ME’

Jennifer Grey Madonna

Jennifer Grey and Madonna starred in 1989's "Bloodhounds of Broadway." (Photo by Robin Platzer/Getty Images)

It didn’t take long for Madonna to make a surprising revelation to Grey.

"She told me she wrote ‘Express Yourself’ about me breaking up with Matthew," the 62-year-old recalled. "She played it for me in her car… I got in her Mercedes where she had a really good sound system and she was like, ‘Listen to this song I just did. It’s about you.’"

According to Grey, it all made sense when she read the song’s lyrics. She noted how her character’s name from "Dirty Dancing" may have been given a shoutout.

The lyrics read: "You deserve the best in life/So if the time isn’t right, then move on/Second best is never enough/You’ll do much better, baby, on your own."

CLICK HERE TO SIGN UP FOR THE ENTERTAINMENT NEWSLETTER

Jennifer Grey Matthew Broderick Madonna

Jennifer Grey said Madonna told her she wrote "Express Yourself" about her breakup with Matthew Broderick. (Getty Images)

And Grey did move on from Broderick. After their breakup, she dated Johnny Depp.

"There was some heat," Grey previously told the outlet about her romance with the "Pirates of the Caribbean" star. "It was a f—king bonfire. It was literally like, ‘Are you f—king kidding me? Are you f—king me?’ I’ve never seen a guy like this. And energetically, what it was like being with him, it was like, ‘Oh, I’m being totally, totally compensated for the s—t I just went through.’"

But in looking back at her past relationships today, Grey said there are no hard feelings. She opens up about her life and career in an upcoming memoir "Out of the Corner," which hits bookshelves on May 3.

"I learned so many things about myself from my relationship with Matthew," she explained. "First of all, we were really young. We were in our mid-twenties when we got together. And from where I sit now, that's pretty young. And we were, I don't know, I can only speak for myself. I was really in love with him. And I was with a guy who had just, whose star had just, it was, he was in such a high moment of his career because he had done ‘War Games’ before I met him and he'd won the Tony and ‘Brighton Beach Memoirs’ and he'd done ‘Torch Song Trilogy.’"

CLICK HERE TO GET THE FOX NEWS APP

Matthew Broderick Jennifer Grey

Actor Matthew Broderick and actress Jennifer Grey at the Academy Awards, circa 1987. (Photo by Donaldson Collection/Michael Ochs Archives/Getty Images)

"And he was just this genius, smart, funny, cute," Grey continued. "I don't know. There was just something so Jewish in New York about him that I just felt like… When you read a little bit more about my family, [it] felt like home and all that that entails, and you keep reading, you'll figure out a little bit more. My feeling about him is love."