TEL AVIV—Israel’s left is attempting to limp out of the political graveyard in a contest to unseat Prime Minister Benjamin Netanyahu.

The left was once the stable for the country’s leaders, and the Labor Party and its predecessor, Maipai, provided seven of 12 prime ministers since Israel’s founding. But no leftist politician has led Israel for nearly two decades. In the last election, in April, Labor saw its worst result, winning only six seats.

Ehud Barak, Labor’s last prime minister, has returned to politics as a leader of a new party in an alliance that wants to lead the left’s attempt at resurrection.

But the Democratic Union alliance, led by Mr. Barak and the head of the Meretz party, will enter the Sept. 17 election separately from Labor, which declined to join them. Labor instead joined forces with a party on the center-right to focus more on socioeconomic issues

Mr. Barak, a former head of Israel’s military, wants to unify leaders on the left, strengthen the wing’s security credentials and topple Mr. Netanyahu, who was his protégé when Mr. Barak commanded the special forces.