United Arab Emirates officials have engaged in secret talks with a Libyan military commander seeking the Gulf state’s help in exporting Libya’s oil outside of United Nations-approved channels, Libyan, Emirati and European officials said.

With the U.A.E.’s assent last month, Khalifa Haftar, the military commander of forces in eastern Libya, moved to cut off his political rivals in Tripoli in western Libya from 850,000 barrels a day of oil production and begin exporting the oil through a breakaway company based in his part of...