There’s a television war brewing for female eyeballs that pits Discovery, home of “90 Day Fiancé,” against NBCUniversal, home to “Real Housewives.”

“90 Day Fiancé” and its spinoff series have helped catapult Discovery to the top when it comes to female viewers — toppling NBCUniversal for the first time ever and causing a stir in the halls of NBC, sources said.

The captivatingly trashy reality show — which gives American citizens and their foreign fiancés 90 days to wed before the foreigner’s visa expires — also boosted ratings at TLC, the Discovery network that airs the show.

For the month of July, TLC beat out NBC’s Bravo — home to the equally audacious “Real Housewives” franchise — among women during the day and in prime time, according to TV ratings giant Nielsen.

NBC’s second-place finish was not well received at NBC, sources told The Post. After Discovery boss David Zaslav crowed about the win on his firm’s earnings call Tuesday, unnerved NBC staffers called up Nielsen to verify Discovery’s claims, a source buzzed.

Adding insult to injury, Discovery then took out ads in major newspapers and across local New York broadcast stations boasting about their newfound status.

“Discovery. The most watched TV portfolio for women in America,” read the ad, which touted not just TLC but also its Food Network, HGTV, ID and Own networks.

Nielsen data from the May 27 to July 14 period shows that Discovery captured 15.8% share of all female viewers, beating NBC, which grabbed 15.2%, and Viacom, which had 13.1%.

Among women aged 25 to 54, TLC beat Bravo by 20% in prime time and 26% in total day for the July 1-to- Aug. 4 period, the data said.

“These networks have made us the number one media company for women 25 to 54 across all of television,” Discovery CEO Zaslav boasted on the company’s second-quarter earnings call.

“This past Sunday night, nearly 35% of the female audience was watching one of our networks,” he added.

The CEO credited Discovery’s $14.6 billion acquisition of Food Network-owner, Scripps, as central to the results, as well as new reality shows spun off from its “90 Day” franchise that has helped it gain new viewers and grab market share.

A Bravo rep brushed off TLC’s July bump, offering that Bravo’s ratings were flat and that it won the first two quarters of the year.

Sources at NBC added that Discovery’s claims are “misleading” because it has 19 networks to NBCU’s 14.

Discovery’s now larger size — thanks to Scripps’s trove of networks from the Travel Channel to Food Network and HGTV — gives them “an advantage,” this person said.

Observers disagree.

“The overall TV marketplace continues to fragment but I’ve got to give Discovery credit,” said Andrew Donchin, chairman of Amplifi, the media innovation and investment arm of Dentsu Aegis Network.

“They’ve bucked the trend with viewership and ad dollars and on the programming side. It’s somewhat of a small sample. but I still think it’s impressive,” he said.