There were tears, cheers and tributes from a host of rock legends as thousands of fans gathered in honour of Hawkins, who was found dead in his hotel room in Colombia in March.
McCartney's appearance was a surprise, causing the crowd to go wild as Foo Fighters singer Dave Grohl introduced him, along with The Pretenders's Chrissie Hynde.
They played The Beatles's songs Oh! Darling and Helter Skelter.
Before performing Helter Skelter, McCartney said: “So Dave rang me up one day and he said, Taylor has written this song called Summer Rain and he said 'we'd like you to drum on it'.
“This group has got like two of the best drummers in the world, and they wanted me to drum on it. So I did.
“Quite a memory.”
Earlier, Grohl grew tearful on stage as he paid tribute to Hawkins.
Before introducing his daughter, Violet Grohl, and British musician Mark Ronson, Grohl said: “When we first started talking about putting something together for Taylor, we sat down and we said even if it's his closest friends, that's like 100 [ …] musicians.
“Because Taylor loved to jam and record with anybody and everybody. He loved to play music every day. And there aren't too many people that he's never jammed with.
“So this collection of friends and family and musicians, this is all brought together by him and we're all connected here today by that one guy.
“Bringing musicians that have never met, musicians that have never played together, all in one place, at one time, with all of you beautiful people to make [ …] noise for Taylor Hawkins.”
Oasis frontman Liam Gallagher opened the event with a rendition of his band's hit Rock 'n' Roll Star, while Grohl played the drums.
Balloons bounced around the crowd as Gallagher immediately followed with Live Forever.
Queen's Roger Taylor and Brian May, Rush, AC/DC singer Brian Johnson, and Nile Rodgers were among the other musicians who performed.
Hawkins' son Oliver Shane Hawkins, pop star Kesha, Sam Ryder and The Darkness frontman Justin Hawkins also made appearances.
Comedians Dave Chappelle and Jason Sudeikis also took to the stage to tell anecdotes about their relationships with Hawkins and his music.
In a pre-recorded message, Sir Elton John told fans “don't ever forget (Hawkins)".
“He loved music”, he said. “He loved playing. He loved the Foo Fighters. Tonight we are honouring his memory.
“So make a noise because he would love that. The Foo Fighters are one of the bands that always give 150 per cent, they never give less than that and nor did Taylor. He was an incredible drummer.
“He played on my last album, which I was so thrilled about and honoured. So tonight is about remembering him, honouring him, and don't ever forget him.”
The event was a celebration of the late musician, who died aged 50, and the band's first performance since his death.
Funds from concert tickets and merchandise will go to the Music Support and MusiCares charities, which were selected by the Hawkins family, who have helped organise the event.
Hawkins had played in the band fronted by former Nirvana drummer Grohl for more than two decades, alongside Nate Mendel, Pat Smear, Chris Shiflett and Rami Jaffee.
The London show will be followed by a second concert on September 27 at The Kia Forum in Los Angeles, with acts such as Alanis Morissette and Chad Smith from Red Hot Chili Peppers on the bill.