The 26-year-old sported a white suit while Cardi rocked a blue bodysuit and white leather corset during their surprise performance of "Taki Taki" on Friday, April 12.
It marked the group's first live rendition of the song, and the former Disney Channel star's first ever gig at the music festival in Indio, California.
The "I Like It" hitmaker posted a photo of the pair along with DJ Snake on her Instagram Story, captioning it, "Coachella and I love them."
Gomez's last appearance at Coachella was in 2017, when she went Instagram official with her then-boyfriend The Weeknd, who was performing at the festival. The couple split later that year, in October 2017, and the "Starboy" hitmaker later reunited with ex-girlfriend Bella Hadid.
The former Disney Channel star hasn't performed since she shared the stage with Taylor Swift at her "Reputation" tour in May last year, and sang her hit "Hands to Myself".
Gomez's surprise appearance on Friday also marks the first time she's sang in public since she entered a treatment facility for anxiety and depression in October, following her kidney transplant.
At the festival last year (2018), Cardi was heavily pregnant with her daughter Kulture, but still performed an incredible set with guest appearances from Chance the Rapper, 21 Savage, YG, Kehlani and G-Eazy.