The two, identified as officials in the ousted government, may appeal against the decision of the Kabul Primary Court.
Aid-worker Bettina Goislard was shot dead at point blank range on 16 November as she sat in her car at a local bazaar in the south-eastern province of Ghazni.
"The two guys first denied that they had killed Bettina and then accused the governor of Ghazni province of torturing and beating them," non-presiding judge Shah Ali Azgher Shahristini said.
"But then the prosecutors presented enough eyewitnesses and strong documents that they couldn't deny it," he said.
The judges, taking into account the documents presented and the accounts of the eyewitnesses, sentenced them to death, Shahristini said.
The convicted men - Zia Ahmad, 28 and Abdul Nabi, 29 - can appeal against the sentence to two higher courts including the Supreme Court. After that President Hamid Karzai must sign a death warrant before they can be executed.
Karzai has not signed a single death warrant since taking power in late 2001.
"The two guys first denied that they had killed Bettina"
Shah Ali Azgher Shahristini,
Governor of Ghazni province Haji Asad said that the three-hour trial, which opened on Tuesday afternoon, began with the two accused pleading their innocence but their pleas were swept aside by mounting evidence.
The judges took 20 minutes to make their final decision.
Asad said that Ahmad had been intelligence director of northern Samangan province under the Taliban and that Nabi had worked with the education department.
The convicted men, who attacked Goislard from a motorbike, were arrested by police shortly after the killing and identified as members of the Taliban. They had lived in Ghazni province since the fall of the Taliban government.
The death of the 29-year-old refugee agency worker, which followed months of increased violence against aid-workers in Afghanistan, prompted the withdrawal of all foreign UN staff from much of the country's southeast.