Stephen Edward Troell, an English teacher, was driving through the capital’s Karrada district when at least two gunmen shot him. He was taken to hospital where he was pronounced dead.
The officials did not identify the Iranian and provided no further details about the case.
The Interior Ministry also confirmed the sentences in a statement, saying four other accused are still wanted.
"The Iranian man was the mastermind of the crime," one legal source told Reuters. All five were arrested in Iraq soon after the fatal shooting, the source said.
At the time of the killing, Mr Troell was working in the local English school, the Global English Institute, run by the Texas aid group Millennium Relief and Development Services.
A native of Tennessee, he had lived in the Iraqi capital with his wife Jocelyn – who was the language school's manager – three daughters and a toddler son, since 2018.
Shortly after the killing, social media accounts close to Iran-backed Shiite militias accused him of being a spy, although they produced no evidence for the claim.
Washington welcomed the sentencing.
"It is critical that all those responsible for the brutal, premeditated assassination of Mr Troell face justice and accountability," Matthew Miller, spokesman for the US State Department, said in a statement.
After the 2003 US-led invasion, Baghdad and many Iraqi cities were off-limits for foreigners because of the deteriorating security situation and widespread kidnapping.
But more recently, foreigners, whether visiting Iraq for work or as tourists, are often seen in Baghdad and other cities roaming the streets and visiting ancient sites without security guards.