Canada is fighting to stop U.S. officials from closing a vital cross-border oil and gas pipeline as a deadline to shut it looms. The dispute erupted in November, when Michigan Gov. Gretchen Whitmer announced she was revoking a permit that allows Enbridge Inc.’s Line 5 pipeline to run along the bottom of the Straits of Mackinac, between Lake Michigan and Lake Huron. She gave the company until May 12 to shut the pipeline.

The 645-mile conduit carries more than a half million barrels of oil and natural gas liquids each day from Superior, Wis., to refineries in Michigan, Ohio, Pennsylvania, Ontario and Quebec.

Canadian officials and Enbridge say closing the pipeline would choke off almost half of the supply used to make gasoline, jet fuel and home-heating oil for Ontario and Quebec, the most populous parts of the country. The closure could lead to higher fuel costs and thousands of job losses in the refineries that process the oil, officials say.

Michigan Gov. Gretchen Whitmer, pictured in April, gave Enbridge until May 12 to shut the Line 5 pipeline.

Enbridge has sued Michigan in federal court to stop the revocation, arguing the state has no authority to do so, and said it won’t shut the pipeline down unless ordered by a court. Michigan cited “the unreasonable risk that continued operation of the dual pipelines poses to the Great Lakes,” in justifying the decision.

The issue has become the biggest irritant between Canada and the U.S. since President Biden’s election. Canadian Prime Minister Justin Trudeau brought up Line 5 during a virtual summit in February with Mr. Biden, who in January had revoked a permit for Canadian operator TC Energy Corp.’s Keystone XL pipeline.

The White House has given no sign that it is prepared to step into the middle of the dispute, but Canada has continued to press officials in the Biden administration. Canada’s Natural Resources Minister Seamus O’Regan, who spoke with U.S. Energy Secretary Jennifer Granholm about the situation, has said the Line 5 pipeline is “nonnegotiable.”

The White House declined to comment.

Canada’s U.S. ambassador, Kirsten Hillman, has met with Ms. Whitmer. She has also spoken to senior Biden administration officials about the stakes involved should Line 5 shut down, such as the future of refineries in Midwestern states and billions in lost annual output. “The regional consequences of shutting down Line 5 are profound,” she said.

So far, the entreaties have had little effect.

“These oil pipelines in the Straits of Mackinac are a ticking time bomb, and their continued presence violates the public trust and poses a grave threat to Michigan’s environment and economy. The governor fully stands behind her decision to revoke and terminate the 1953 easement, while securing Michigan’s energy needs,” a spokesman for Ms. Whitmer’s office said.

Former Canadian diplomats and officials say Ottawa hasn’t yet been able to persuade the Biden administration to stop Michigan’s government under the terms of a 1977 U.S.-Canada treaty that prohibits authorities in either country from blocking pipelines that ship oil and gas across the border unless there is an emergency.

An aboveground section of Enbridge’s Line 5 at the Mackinaw City, Mich., pump station.

The Biden administration could issue an order that the pipeline treaty applies in this case and Michigan’s governor cannot interrupt the flow of oil through Line 5, said Kristen van de Biezenbos, a law professor at the University of Calgary and a specialist in energy regulation. But that option depends on the White House’s willingness to enforce the treaty, she said.

“If Biden refuses to intervene altogether, Canada would not have a way to stop the revocation and would have to rely on Enbridge’s success in court,” she said.

A U.S. court will have to decide whether the 44-year-old treaty—which neither the U.S. nor Canada has invoked—can be enforced without the need for a U.S. government directive, she said.

Enbridge is now engaged with Michigan in mediation that was ordered by U.S. District Judge Janet Neff of the Western District of Michigan. Judge Neff will decide whether Enbridge’s lawsuit will be heard in state or federal court but wants to offer the parties a chance to resolve their differences first.