The Supreme Court on Tuesday removed a hurdle to the construction of a natural-gas pipeline through Pennsylvania and New Jersey, ruling the pipeline developer could invoke the power of the federal government to take state property needed for the project.

The court’s 5-4 opinion, by Chief Justice John Roberts, handed a considerable victory to the natural-gas industry by rejecting New Jersey’s challenge to the actions of the PennEast Pipeline Co., a joint venture of several energy companies that aims to build a 116-mile interstate pipeline.

The Federal Energy Regulatory Commission authorized the project and, under the Natural Gas Act, that approval allowed the company to use federal eminent domain power to take possession of the land, if necessary.PennEast said it was able to negotiate rights of way with most property owners, but went to court in its bid to take dozens of parcels of land—with compensation—in which the state of New Jersey holds a property interest.New Jersey objected on sovereign-immunity grounds, arguing that a private party like PennEast, a Delaware company, can’t drag a sovereign state into federal court against that state’s wishes.The Supreme Court rejected that argument.

“Although nonconsenting States are generally immune from suit, they surrendered their immunity from the exercise of the federal eminent domain power when they ratified the Constitution,” Chief Justice Roberts wrote for the majority.

The federal government, he said, could delegate that power to private parties who “can initiate condemnation proceedings, including against state-owned property.” The court said such delegations have been present—and lawful—throughout the nation’s history.

The decision reversed an appeals court ruling in New Jersey’s favor, restoring the status quo and giving the energy industry, under FERC oversight, broad power to use eminent domain to help build pipelines that cross state lines. PennEast said the ruling would preserve the industry’s ability to deliver low-cost natural gas at affordable prices.

What the ruling may not do, however, is save PennEast itself, said Christi Tezak, managing director at Clearview Energy Partners LLC. It faces further challenges from environmental groups out of New Jersey over its greenhouse-gas emissions and its necessity for consumers, likely leading to extensive further delays that could kill the project.

“It was a very important case to the industry,” Ms. Tezak said. But “it’s not going to release PennEast for clear sailing.”