Gabi Ashkenazi will also join them, making him the third former IDF chief in the party, in addition to Gantz and to former defense minister Moshe Ya'alon.
In the joint party's Knesset list, Gantz will be placed first, Lapid second, Ya'alon third and Ashkenazi fourth. Under the agreement, the joint party will include an equal number of candidates from Israel Resilience and from Yesh Atid, and will also include candidates from Ya'alon's Telem Party.
The Israel Resilience Party, in a statement, said Gantz, Lapid and Ya'alon, "decided to establish a joint list that will comprise the new Israeli ruling party."
Gantz and Lapid, who met overnight, agreed on a "rotation for the prime minister's post" in which Gantz would hold office for the first two and a half years of a new government's term before Lapid took over.
"The new ruling party will bring forth a cadre of security and social leaders to ensure Israel's security and to reconnect its people and heal the divide within Israeli society," the statement from Israel Resilience said.
MK Orly Levy-Abekasis was also holding talks with Gantz on a possible merger between Israel Resilience and her Gesher Party, but late Wednesday night she announced that her party will run alone after the talks with Gantz failed. "Gantz is being managed by others," said Levy-Abekasis.
In anticipation of the announcement of the new centrist alliance between Gantz and Lapid, Prime Minister Benjamin Netanyahu orchestrated a merger of far-right parties on Wednesday that could help him build a governing coalition after the ballot.
Israelis vote for party lists of candidates for seats in the 120-member parliament, the Knesset. Since Israel's creation in 1948 no one party has clinched an outright majority in the legislature and so post-election coalition-building has determined the composition of governments and who leads them.
Netanyahu, 69, has been in power for the past decade, with Likud at the helm of a parliamentary bloc.
Opinion polls have forecast a Likud victory, with some 30 parliamentary seats, in the April 9 ballot, with Israel Resilience and Yesh Atid each trailing by a wide margin and Netanyahu on track to form a rightist coalition similar to the one he heads.
But the surveys also predicted a much tighter race and a possible upset should Gantz, 59, and Lapid, 55, team up and then form a centrist and left-wing parliamentary bloc larger than a Likud-led alliance.
While Gantz and Lapid worked out their deal, Netanyahu helped negotiate the merger of Jewish Home-National Union and Otzma Yehudit (Jewish Power), that could give followers of the late anti-Arab rabbi, Meir Kahane, a stronger voice in politics.
Leaders of Otzma Yehudit have portrayed themselves as successors of the US-born Kahane, who served one term in the Knesset in the 1980s as head of the Kach party.
Kach advocated the "transfer" of Palestinians to neighboring Arab countries and also called for a ban on intermarriage between Israeli Jews and Arabs.
Kahane's movement was subsequently banned from Israeli politics as racist. He was assassinated in 1990 in New York by an Egyptian-born American.
Reuters contributed to this story.