The film, starring Julianne Moore and Ellen Page as a couple fighting for pension benefits, had its world premiere at the Toronto International Film Festival on Sunday night (13Sep15), and the Wrecking Ball hitmaker took to to reveal she collaborated with famed writer Perry for a special tune in the movie.

Posting a photo of Moore, Page and co-star Michael Shannon, Cyrus wrote, "proud to be apart of @freeheldmovie singin a tune written by da (the) bad a** @jesusonmars (Perry) & thank you to this incredible cast for giving a face to this incredible story and shining light on the brutal dark truth of love vs the law!"

Cyrus has been a longtime gay rights advocate, while Perry has been openly gay for most of her career.

Freeheld is based on a 2007 documentary, which centred on Laurel Hester - a New Jersey cop played by Moore - who challenged government officials and demanded pension benefits for her same-sex partner, Stacie Andree, portrayed by Page, as she battled lung cancer.

The film is due in U.S. cinemas on 2 October (15).