The former N-Dubz star initially recorded Scream & Shout for her debut solo album The Female Boss, but it was dropped from the record and subsequently given to will.i.am and Spears.
The song was a chart hit in both the UK and US following its release last year, and Contostavlos is now suing the Black Eyed Peas star over claims she wrote some of the song's lyrics.
The singer has filed a lawsuit alleging she is owed royalties and a writing credit, according to Britain's The Sun newspaper.
A source told the publication: "She's well within her right to claim some of the publishing money. If she proves the words are hers, she could get a huge pay-out."
The song was originally titled I Don't Give A F**k and will.i.am recently confirmed rumours Contostavlos had worked on it before him, saying: "She (Contostavlos) wrote to that song (Scream & Shout) before I did - this is the truth. But the producers of the beat - two brothers from Belgium called Lazy Jay - didn't want her to have it, so I wrote to it and Britney is the only person I ever had in mind."
Contostavlos' album The Female Boss was hailed as a massive flop following its release in December - the record entered the UK album chart at a disappointing number 35 and sold just 15,000 copies in its first seven days of release, before dropping straight out of the top 40.