As part of his performance on Saturday night, which had guest appearances by Dave Grohl and Bruce Springsteen, the former Beatles singer included footage of Depp while performing 2012's My Valentine.
The visuals, which show Depp and fellow actress Natalie Portman using sign language, are part of the song’s official music video.
The inclusion divided fans on social media, with critics decrying the move owing to the domestic abuse allegations surrounding Depp and ex-wife Amber Heard.
Their highly publicised defamation case ended earlier this month in the US, with both sides ordered to pay each other damages.
McCartney did not address the video on stage and has yet to comment on the divided reaction.
Despite the controversy, McCartney’s show fulfilled expectations.
Taking the Pyramid Stage to close the penultimate day of the festival, he played a mammoth 38-song set representing his celebrated six-decade career, and became the oldest solo headliner in the music event's history after he turned 80 this week.
Beatles fans were thrilled with a hefty selection of tracks from the Fab Four, including Hey Jude, Blackbird, Get Back and Can't Buy Me Love.
Hits from Wings were also presented with Live and Let Die, Let 'Em In and Let Me Roll It.
Special guests Springsteen and Grohl appeared in the final quarter of the show.
The former joined McCartney for a triumphant take of The Beatles I Wanna Be Your Man, while Grohl played the Wings classic Band on the Run.
All three rocked together along to The End, the Beatles track that closed the epic performance.
McCartney's set also featured the singer waving the Ukrainian flag in support of the country amid its war with Russia.
This comes a day after Ukrainian president Volodymyr Zelenskyy addressed the crowd via video link. He described the event as the “greatest concentration of freedom” and called for the world to “spread the truth” about Russia's invasion of Ukraine.
That support was further underlined with the country's Eurovision entry, the Kalush Orchestra, also performing on Friday as part of the festival.
The event continues on Sunday with a final day of big performances led by the night's headliner, hip-hop star Kendrick Lamar.
Also on the programme are New Zealand pop star Lorde, soul singer Diana Ross and pioneering jazz artist Herbie Hancock.