Spears co-wrote dance track Whiplash, which reportedly failed to make it onto her Circus album and was subsequently offered to Gomez for her new LP, When The Sun Goes Down.
And Gomez, 18, said that she wasted no time in snapping it up.
'It's awesome,' she told MTV News. 'It was an honour and I'm completely stoked.
'I just heard the song. I fell in love with it. They gave it to me, the producers who worked on it, and I came and sang and saw that she had co-written it, so I was very excited.'
And she is planning on paying homage to her hero with a Britney tribute during her forthcoming summer tour.
'We are working on a few cover songs. We are working on a Britney tribute,' Gomez told MTV News earlier this year. 'I wanna do a mash-up of all her songs and just go for it ' Baby One More Time, and then I think we're going to try to incorporate Toxic and that phase. And then we might do some of her recent, new stuff.'