PEOPLE has an exclusive look at the duo's performance of the 1961 hit, above, at the fourth edition of the LuisaViaRoma for UNICEF gala at the Certosa San Giacomo of Capri.
Perry appeared in a sparkling, gold Dolce & Gabbana dress and a long, white wrap while Legend sat at the piano in a classic white dress shirt, black pants, and matching loafers.
Legend was in good spirits when PEOPLE spoke with him at the event.
"Everyone is enjoying being fancy tonight but it's so important the work UNICEF is doing to make the world better," the Grammy-winning musician said.
Also in attendance were Perry and Legend's partners, Orlando Bloom and Chrissy Teigen. During the event's finale, American Idol judge Perry honored the work of UNICEF, which her fiancé has worked closely with for ten years.
Perry and Legend performed a collection of their hits during separate sets throughout the night. The pop star played "Firework" and even kissed a fan's hand during an encore performance of her 2008 breakout hit "I Kissed a Girl."
"This is better than being stuck in a room and we get to dress up," Perry said from the stage mid-set.
Prior to her set, Legend spent 20 minutes playing some of his most popular ballads. PEOPLE even spotted Teigen adorably filming her beloved husband offstage.
Several other high-profile guests attended the star-studded event, where guests enjoyed Casamigos, including Vanessa Hudgens, Maria Bakalova, Saweetie, Emily Ratajkowski, Olivia Culpo, Sabrina Elba, and Sandra Lee. Heidi Klum was also there with husband Tom Kaulitz and daughter Leni, whom she shares with Seal.
The night also included a performance art piece called "Franchise Freedom" by Studio Drift, an incredible drones display over the skies of La Certosa, and an auction.
An auction at the gala, conducted by Harry Dalmeny of Sotheby's, included several one-of-a-kind items: Steve McQueen's 1961 Cooper Formula Junior race car; art by Andy Warhol, Alex Israel, and Richard Orlinski; a notebook of drawings by Pablo Picasso; and the Yamaha grand piano played by Legend during his performance earlier in the evening.
More than €5 million was raised in support of UNICEF's work to provide care and protection to vulnerable children across the globe.