As Iran and Israel inch toward all-out war, the timing is suitable. On Thursday Jews don costumes and feast to celebrate Purim, the “they tried to kill us, we survived, let’s eat” holiday par excellence. Purim commemorates the tale of the Jews’ narrow escape from extermination in Persia’s Achaemenid Empire.

The story, told in the book of Esther, takes place in the fifth century B.C., a millennium before the rise of Islam. King Xerxes, whose realm stretches from “India to Ethiopia,” selects Esther as his new queen. She conceals her Jewishness, but her cousin and foster father, Mordechai, doesn’t. He refuses to prostrate before the king’s vizier, Haman. Enraged by Mordechai’s defiance, Haman persuades the king to exterminate all the Jews of Persia.

After some political maneuvering, Esther audaciously reveals her identity and everything turns upside down. Xerxes orders Haman hanged on the gallows meant for Mordechai, and the Jews defeat their enemies in a two-day war across the Persian provinces.

It’s tempting to read the book of Esther as prophecy rather than history. Today’s Iranian regime denies the Holocaust, issues constant threats to “erase the Zionist entity,” and stations Quds Force troops and proxy militias from its own border with Afghanistan to Syria’s and Lebanon’s with Israel.

Prime Minister Benjamin Netanyahu has been invoking the holiday for years. In March 2012 he gave President Obama a Purim Megillah scroll while discussing Iran’s nuclear capabilities. Last year Mr. Netanyahu told Russia’s President Vladimir Putin: “Today there is an attempt by Persia’s heir, Iran, to destroy the state of the Jews. They say this as clearly as possible and inscribe it on their ballistic missiles.” Mr. Putin, an Iranian ally in Syria, dismissed the comparison: “We now live in a different world. Let us talk about that now.”