She was sentenced for providing "logistical support and helping the terrorist group to carry out crimes," said court spokesman Abdel Settar Bayraqdar.
"The accused admitted during interrogations that she left Germany for Syria then Iraq to join IS with her two daughters, who married members of the terrorist organisation," he said.
In September 2017, the same court sentenced to death by hanging a Russian man who was captured in Iraq's second city Mosul and found guilty of fighting for IS.
The same month, a German teenage girl suspected of joining IS was arrested in Mosul, according to Germany's justice department.
More From This Section
German daily Der Spiegel reported she had been held in Baghdad with three other German women including one of Moroccan origin.
Baghdad declared victory over IS in December after expelling the jihadists from vast areas of Iraq it seized in 2014.
There are no official figures for arrests of jihadists during the battle against IS, but Iraqi commanders and Iraqi Kurdish fighters say hundreds gave themselves up.
In the province surrounding Mosul alone, more than 4,000 jihadists were arrested, police chief General Wathiq al- Hamdani said.
Despite Baghdad declaring victory over the jihadists, IS has continued to carry out attacks including in the capital.