Both countries have moved to revive long-stalled projects in light of a gas supply crunch following Russia's invasion of Ukraine a year ago. Prices surged and Europe -- which was heavily reliant on Russian gas -- had to look elsewhere for energy.
Rabat is hoping the Nigeria-Morocco Gas Pipeline, which would skirt the coastlines of 13 West African countries, could pump billions of cubic metres of natural gas to the kingdom.
From there, the gas would flow through the Maghreb-Europe gas pipeline (GME) into Spain and Portugal.
Nigeria's Oil Minister Timipre Sylva told AFP that a feasibility study was underway and some countries had already signed up to the project, but a start date has yet to be set.
To the east, Morocco's neighbour and arch-rival Algeria is pushing to relaunch plans for a Trans-Saharan Gas Pipeline linking Nigeria to Algeria's Mediterranean coast via Niger.
Last July, Algiers signed a memorandum of understanding with Abuja and Niamey to bring the 4,128-kilometre (2,565-mile) pipeline to fruition, at a cost of up to 18 billion euros ($19 billion).
From Algeria the gas could be pumped via the Mediterranean undersea Transmed pipeline to Italy through Tunisian territory, or loaded onto liquefied natural gas tankers for export.
The renewed momentum on both projects follows months of heightened tensions between Algeria and Morocco after the collapse of a decades-old ceasefire in the Western Sahara and Morocco's normalisation of ties with Israel in late 2020.
In August 2021 Algiers cut diplomatic links with Rabat altogether, accusing it of "hostile acts", which Morocco denies.
Later that year, Algeria declined to renew a 25-year deal to pump gas through Moroccan territory to Spain in exchange for gas that covered almost all of Morocco's needs.
The loss of that gas helps explain Morocco's drive to make its 6,000-kilometre pipeline project, launched in 2016, a reality.
Morocco's deal with Nigeria and their West African neighbours is set to cost 23 billion euros, but Sylva noted that the project would involve complex negotiations.
"There are certain agreements that you must sign with every country" on the route, he said.
Rabat and Abuja did make progress last year, signing MoUs with seven of the 13 countries in question as well as with the Economic Community of West African States, a regional bloc.
Rabat is hoping the pipeline, combined with Nigeria's vast hydrocarbon reserves, can create "a stable, predictable and mutually profitable gas market", said Moroccan researcher Jamal Machrouh.
Europe has a "strategic interest" in the project, Machrouh added.
At the same time, Algeria is pursuing anew its own similarly challenging pipeline, started in 2009. The project would have to pass through thousands of kilometres of desert including some areas where jihadist groups have waged a long insurgency.
Algeria is Africa's biggest gas exporter and the third-largest gas provider to Europe.
Algerian expert Ahmed Tartar said the pipeline project could be finished within three years and would "meet an important part of Europe's future needs".
But Maghreb geopolitics expert Geoff Porter told AFP in September that "a pipeline like this would be hugely vulnerable, not just to attacks by jihadists but also by local communities if they feel they're getting exploited by a project from which they derive no benefit".
"Then there's the bureaucratic element, which is extremely complex," he added. "Then, who's going to finance it?"
Algeria's Energy Minister Mohamed Arkab said on February 18 that technical studies were underway. He insisted that "this African project will benefit the countries it crosses", and even neighbouring ones.
Both pipelines could be viable for Europe, as the continent would not want to overly rely on "a single player" for its energy supplies, Machrouh said.
But they would also come online as Europe engages in longer term efforts to wean itself off fossil fuels -- including gas.
During a January visit to Rabat, EU foreign policy chief Josep Borrell said of the pipeline: "You have to consider when it will be finished. Will we still want to use gas, methane?"
Borrell suggested Morocco could focus efforts on its enormous wind and solar energy potential as well as selling hydrogen to Europe.
A senior European diplomat, speaking to AFP on condition of anonymity, put it more bluntly: "In the future, we won't be buying gas any more."