Click to email this to a friend (Opens in new window)

Click to share on Twitter (Opens in new window)

Click to share on Facebook (Opens in new window)

Mary Max — the wife of pop artist Peter Max who committed suicide on Sunday in their Upper West Side apartment — had attempted to take her own life before, friends said.

Multiple sources told Page Six that Mary, 52, had tried to commit suicide “years ago” and succeeded this past weekend.

She was discovered in the apartment she shared with Peter, 81, on Riverside Drive near West 84th Street on Sunday evening, cops said. The cause of death was said to be “nitrogen asphyxiation” but remains under investigation.

Sources told Page Six that a May blockbuster New York Times profile — on psychedelic artist Peter’s alleged “advanced dementia,” and his family’s bitter battle to control his life, art and legacy — had taken its toll on Mary.

“She wasn’t happy with it,” said a friend about the article, which detailed the legal battle Mary has been in with Peter’s children since 2015.

“For five years and counting . . . the artist’s family, friends and associates have been trading lurid courtroom allegations of kidnapping, hired goons, attempted murder by Brazil nut, and schemes to wring even more money out of what was already one of the most profitable art franchises in modern times,” reported the Times.

The piece recounted how Mary — Peter’s second wife, whom he met in 1996 — asked a court to appoint a guardian to oversee her husband’s business, and how she alleged that Peter’s son, Adam, had effectively “kidnapped” his father.

Adam reportedly fired back that he was protecting his dad from Mary’s “verbal and physical abuse,” and the piece said, “Several sworn affidavits described [Mary] as a neglectful, even punishing, figure in her husband’s life.”

The 2015 case was “disposed,” according to court records, and a judge ordered Peter to remain under Mary’s care.

His daughter, Libra, recently returned to New York to help the ailing artist.

Mary reportedly left “farewell messages” with a friend for loved ones, including for her husband, a brother and her 94-year-old mother. A rep for the family did not comment.