The group said in a statement posted on a web forum on Thursday that its "Islamic court" had judged the two men as "apostates" who were waging a "war on Islam".
"Based on this, the court decided to issue God's verdict upon the apostates and sentenced them to death," it said.
The statement, whose authenticity could not be confirmed, did not say whether the two men had been killed yet.
The Moroccan Foreign Ministry has identified the missing members of its diplomatic mission in Baghdad as driver Abd al-Rahim Boualam and employee Abd al-Karim el-Mouhafidi, saying they disappeared on 20 October while driving to Baghdad from Jordan, where they had gone to pick up their pay cheques.
The statement said the two Moroccans "compounded their disbelief in God and their war on Islam by supporting the government of the Shiite apostates in Baghdad. This is what their statements have confirmed and what their government has not concealed, sending them to pave the way for the ambassador who they promised the Baghdad government.
"May they be a new lesson for us to disperse those who might follow them, those who dare challenge the mujahidin and set foot in the proud land of Mesopotamia," the statement said.
In July, al-Qaida in Iraq, said to be led by Jordanian fighter Abu Musab al-Zarqawi, kidnapped and killed the head of the Egyptian mission in Iraq after that country said it would send an ambassador to Baghdad.
Days later, the group also killed the head of the Algerian mission and another Algerian employee.