In a letter, the former Beatle told Putin that he wrote his playful homage to the former Soviet Union in 1968, "back when it wasn't fashionable for English people to say nice things about your country."
Quoting the song's line "Gee it's good to be back home," McCartney asked: "Could you make that come true for the Greenpeace prisoners?"
The 28 protesters, as well as a photographer and a videographer working for Greenpeace, were detained aboard their ship, the Arctic Sunrise, on September 18 after staging a protest at an oil rig owned by Russia's Gazprom state energy giant.
In the letter, posted on McCartney's official website, the musician cited his long association with Russia, including an outdoor concert in Red Square in 2003. On that occasion, Putin gave McCartney a personally guided tour of the Kremlin. McCartney told Putin he hoped they would meet again, "when our schedules allow."
More From This Section
He said Greenpeace, which stages direct-action protests against alleged environmental offenders around the world, was nonviolent and "most certainly not an anti-Russian organization. In my experience they tend to annoy every government!"
An outspoken vegetarian, McCartney has long supported environmental causes, and he has opposed drilling for oil in the Arctic.
He also was one of several international celebrities who last year urged Russia to free two members of punk protest group Pussy Riot. They remain in jail.