Washington CNN  — 

Jennifer Lopez sought marriage advice from an unlikely source as she prepares to tie the knot: the “Notorious RBG.”

US Supreme Court Justice Ruth Bader Ginsburg said the global pop star called her “about a month or so ago” wanting to meet the justice and introduce her baseball legend fiancé, Alex Rodriguez. (The couple got engaged in March.) The 86-year-old dished on the meeting during an event Saturday at the Library of Congress.

The couple, Ginsburg recalled, came to her Supreme Court chambers where she said they “had a very nice visit.”

“She mostly wanted to ask if I had any secret about a happy marriage,” the justice said of Lopez. “But now A-Rod is traveling with her to concerts all over the world.”

Ginsburg was married to her husband Marty Ginsburg for over 50 years before he died in 2010.

Ginsburg, who’s Brooklyn born, was coy in revealing what she specifically told Lopez, who’s from the Bronx.

“So what was your secret to a happy marriage? Did you pass on your mother-in-law’s secret?” Ginsburg was asked on Saturday by NPR’s Nina Totenberg.

The justice laughed and then shared the advice she received on her own wedding day.

“On the day I was married, my mother in law – I was married in her home – she took me aside and said she wanted to tell me what was the secret of a happy marriage,” Ginsburg said Saturday.

Her mother-in-law’s advice? “It helps sometimes to be a little deaf,” Ginsburg said, adding that she has followed that “good advice” in “every workplace, including the good job I have now.”

CNN’s Aishvarya Kavi contributed to this report.