The singer, who has had 19 number one singles and sold more than 200 million albums, will play Pride in the Park on Saturday 1 August.
The three-day event runs from 31 July to 2 August. On Sunday, The Pussycat Dolls – who recently reformed – are the headline act.
Chris Jepson, from the festival, said Mariah was “a huge LGBTQ+ ally”.
Last year, Kylie Minogue headlined the festival, and in 2018 Britney Spears wowed a crowd of 57,000.
Spokesperson for the festival, Mr Jepson, said signing Mariah had taken months of planning and organising.
He added: “She wants to come and do this event.
“She got the GLAAD award in 2016 so she’s a huge LGBTQ+ ally and works with the community for acceptance and inclusion. She’s been a friend of the community for many many years.
“She’s a global icon, not just for the LGTBQ+ community.”
He said he did not know how much she was being paid for the gig.
Last year the festival brought more than 250,000 people to the city.
However, environmentalists criticised revellers for the volume of litter left behind, including a huge amount of laughing gas canisters.
More than 100 artists will be playing on a number of stages over the three days, and Mariah will play a 75-minute set.
Mr Jepson said Pride was excited for “everything Mariah can throw at us” and is hoping “she’s going to pull out all the big hits”.
“We’re getting so big now and people want to play our festival, we’re getting people approaching us and asking to do it, which is great,” he added.