The Pit is far from Gotham (Which, by the way is in New Jersey, not New York, just so people know).
It was filmed in India, but the film location and the actual in story location are not the same.
The Pit is officially in a 'Middle Eastern' Country, but it is never specified which. This is meant to leave it intentionally vague, since DC has many fictional countries like Kahndaq (quoting Dc's wikia): "Kahndaq is an Arab country on the continent of Africa located between Egypt and Jordan." except when you look at the Continent it is on in the side bar, it says Asia (which actually matches the real world map concept that the Middle East is considered part of Asia), and if you consider what it says, it essentially is Israel... though other references have Kahndaq frequently considered part of what is Iran. This all convolutes matters, since Israel, Jordan, Iran, Egypt, Iraq (which also has DC fictional Qurac as a stand-in at times), and Libya (which has its own stand-in at times of Bialya, a near anagram) (among others) are all acknowledged to exist in DC as well...
Since making it in a real country could be taken as offensive, Bialya has Queen Bee ruling it, and Kahndaq is ruled by Black Adam... Qurac would seem the most likely place in DC's fictional Middle Eastern countries to place the Pit. Note this part is only my theory, but since the Pit is a pastiche for multiple places in the mainstream Batman Mythos, and is further complicated by being filmed in India yet having a Moroccan Chant, and supposed to be in the Middle East, the conjecture is fairly sound with the available information.
Fun note: Joker in the comics actually was given Diplomatic Immunity for a while by being declared Iran's UN Ambassador. So, there is always still Iran, as well.