Precedent suggests that this would require Pennsylvania and New Jersey to consent, with the approval of Congress; Philadelphia would have absolutely no legal say in the matter, although it would be exceedingly unlikely that they would be kicked out without their consent.
City
Philadelphia's powers are those granted by its charter, which are those of local self-government and in performance of its municipal function. Philadelphia cannot pass a law cancelling out a state law; nothing they do can change the Pennsylvania law setting the border with New Jersey, nor can it stop Pennsylvania from changing the borders of the state to exclude Philadelphia. Philadelphia, unlike Pennsylvania, isn't sovereign, and so has no inherent say in the matter.
States
Pennsylvania and New Jersey don't have to listen to each other's laws in general. As mentioned, Philly is a nonentity in this discussion, so neither can be forced to accept the change by the other. Furthermore, the state border compact cannot be changed unilaterally; both must agree to change it. So neither state can do it without the other. Pennsylvania's constitution assumes there's a city of Philadelphia, which might be a problem, but it's resolvable with a constitutional amendment (that doesn't require Philly's approval). This wouldn't be a local law, so it doesn't seem like the Pennsylvania constitution prohibits this border change.
Congress
Congress can trump state law in some cases. However, they still can't do this change without the consent of both states. While Article IV Section 3 only talks about new states, that's because it's restricting the just-given power to make new states. Likewise, the part of Article I letting Congress directly administer a federal district requires that it have been ceded by the states it was cut out of. In Geofroy v. Riggs, the Supreme Court ruled that
It would not be contended that [the treaty power of Congress] extends so far as to authorize what the Constitution forbids, or a change in the character of the government, or in that of one of the states, or a cession of any portion of the territory of the latter, without its consent.
So, there's pretty strong evidence based on the structure of the Constitution that Congress needs state approval to strip that state of territory. Congress and New Jersey aren't enough to move Philadelphia. There's much less on expanding a state without its consent (presumably because they're less likely to object to expanding), but the whole structure of the Constitution is against the idea that Congress can do that (and thus force New Jersey to, say, let Philadelphia residents vote in their elections).
However, Congress's approval is necessary; a Pennsylvania-New Jersey border agreement is an interstate compact, and while not all compacts need approval, ones that affect federal power do, and a specific example in the case is that a compact moving a populous and important part of a state to another state will likely need approval (Virginia v. Tennessee).
Real life
State border changes are by no means unheard of; these are normally resolving poorly-defined borders or making minor tweaks (example: Texas-Oklahoma Red River Compact). These changes are always done with a formal interstate compact involving approval by both legislatures and by Congress (although Congressional approval may be implicit, it would not be in the case of Philadelphia). Philadelphia can't legally stop Pennsylvania or New Jersey or Congress from agreeing to change the border to go on the other side of the city (although they could, in practice, make it not happen because no one would do it without extremely strong support in the city).
Standing
You have standing to sue over something when you are directly harmed by that something, and if you picked the right court (this would end up in the Supreme Court pretty definitely, so "right court" is a bit irrelevant). Pennsylvania has standing to sue if they lose territory. New Jersey could almost certainly bring suit as well. The US probably couldn't directly sue. However, all three groups could end up arguing it indirectly, which happens as soon as someone ignores the change and is sued over it, or the question of which state Philadelphia is in arises some other way. A private citizen could end up bringing the suit, for that matter (just sue someone in the rest of Pennsylvania and try to remove it to federal court, which requires that Philly not be in New Jersey). In any event, all three entities would submit amicus briefs that would be seriously considered.
Philadelphia is a bit more complicated; the City does not have independent legal existence. It exists as a legal entity because Pennsylvania says so; if it's not a legal entity, it can't sue anyone or be a party to any case. In practice, it would likely keep operating until the legal stuff gets worked out and it returns to Pennsylvania or is re-incorporated in New Jersey, and its lawyers would file an amicus brief as well. But if they try to sue without being re-incorporated in New Jersey, I'm not sure that they meet the "is a legal entity" requirement to be a party in a case.