After being invited to give her choice as part of HMV's "My Inspiration" campaign, Madonna cited the line "Jesus died for somebody's sins, but not mine", which Patti Smith added to Gloria originally written by Van Morris and recorded by Them, as her key inspiration. The almost six-minute version of Gloria is featured on Smith's 1975 debut Horses.
Madonna has long been known for her references to religion throughout her work and her friendship with Patti Smith recently made the headlines.
Madonna was the the 300th artist to take part to the HMV campaign that began in 2006 when David Bowie selected a line from Syd Barrett's song Gigolo Aunt. Sir Paul McCartney, Bob Dylan and Lady Gaga are among the other names to have taken part.
HMV spokesman Gennaro Castaldo said: "We've been honoured to have some truly legendary artists take part in recent years, but we're particularly proud and thrilled that Madonna has agreed to participate to celebrate our 300th landmark.
"Naturally we were really intrigued to learn her choice, but should have guessed that, in Patti Smith, she'd go for another artist who has rewritten the rules and, in Gloria, a song that makes a powerful statement."