Pay up or get out.

Con Ed has given the Ground Zero mosque an ultimatum: Pay the $1.7 million you owe in back rent, or we’ll terminate your lease and take back our property.

Con Ed and mosque developer Park51 have an unusual, uneasy alliance, sharing ownership of a site slated to be one of the most controversial projects in city history.

The utility owns a former substation on the western half of the property, at 51 Park Place, and the mosque developers own a five-story building on the eastern half. The buildings were connected years ago and used to house a Burlington Coat Factory store.

Park51, which leases the substation from Con Ed, wants the two buildings so it can knock both down and build a $100 million, 15-story community center.

But the plan hit a major obstacle in August when Con Ed raised the rent from $2,750 a month, a rate set in 1972, to $47,437 a month, retroactive to July 31, 2008, The Post has learned.

GROUND ZERO MOSQUE DOESN’T HAVE A PAYER

When the mosque failed to fork over the $1.7 million, the utility fired off a letter demanding the money by Oct. 4 and threatening to evict.

Park51 principals responded with a lawsuit to stop the increase, calling Con Ed’s rent demands “outrageous.”

“Whether it is bowing to political pressure or seeking to retain the valuable premises for itself, Con Ed appears intent on proceeding with its wrongful termination,” argued Sharif El-Gamal, the lead Park51 developer.

Gamal said Con Ed’s move also wipes out his ability to eventually buy the substation building, where the Park51 developers have converted the first floor into a prayer space. They turned the first floor of the adjoining building into a cultural center and recently debuted their first event, a photography exhibit.

The modest space is in sharp contrast to the expansive plans unveiled last year that generated worldwide controversy for their proximity to Ground Zero.

Gamal’s group bought the building at 45-47 Park Place in 2009 for $4.8 million and, at the same time, paid $700,000 for the lease at the substation.

The deal was considered a bargain as the entire property had been on the market for $18 million only a few years earlier.

The lease with Con Ed included an option to buy, which Gamal said in 2010 that he wanted to pursue. If he doesn’t own the Con Ed property, he would have to get any demolition approved by the utility.

After conflicting appraisals of the property by Gamal and Con Ed, it seems both sides came to an agreement this summer.

Court papers show that the appraised price for the Con Ed property is $10.7 million. But Gamal contends Con Ed’s math was faulty when it calculated the rent, saying it owes only $881,519 in back rent and should have to pay $25,875 a month going forward.

Gamal got a court order to temporarily prevent Con Ed from ending his lease.

A hearing is set for Nov. 17.