The Doctor Who and Human Target stars will appear in two 90-minute instalments of Alan Furst's novel to air on BBC Four and Poland's TVP.
Tennant is set to portray Colonel Jean-Francois Mercier, a decorated war hero who begins an affair with Montgomery's Parisian lawyer Anna in the run-up to World War Two.
The Spies of Warsaw, which takes place in London, Paris, Berlin and Poland, is penned by The Likely Lads writers Dick Clement and Ian La Frenais.
BBC Four controller Richard Klein said: "Spies of Warsaw is Alan Furst at his best - a tense, passionate and sexy love story set against the increasingly strident clang of coming war.
"I think David Tennant playing Mercier and Janet Montgomery as Anna is such an exciting way to explore Furst's hugely convincing central characters, and I am delighted that Ian and Dick have produced such an enthralling script.
"Spies of Warsaw is an entertaining, thrilling and insightful drama with a very different take on the Second World War, seen through the eyes of characters who know from the start that they and their fellow countrymen will face the brunt of the horrors to come: this is top class drama, and perfect for BBC Four."
Richard Fell, head of drama at Fresh Pictures - who are producing with Apple Film - added: "We are thrilled and delighted that David and Janet are going to be in Spies of Warsaw. They are both actors of such great range and quality they will light up the screen as the star-crossed lovers.
"As Europe is dragged into the nightmare that will be the Second World War, their illicit love affair gets ever more complicated, and the chemistry between these two extraordinary actors becomes irresistible."
Filming is scheduled to begin next month in Poland.
> David Tennant, Tom Jones, Emma Thompson for new Sky Arts shows