The bombing, which struck near a checkpoint in the Kadhimiyah area, home to a major Shia shrine, also wounded at least 29 people, the officials said.
IS issued a statement claiming the attack, saying it targeted soldiers and pro-government paramilitaries in the area.
The jihadist group frequently carries out attacks on security forces, and also often targets members of Iraq’s Shia Muslim majority, whom it considers heretics.
An IS suicide bomber struck shoppers in Baghdad’s central Karrada district earlier this month, killing 292 people.
The group also claimed an attack on a Shia shrine in Balad, north of the capital, that left 40 dead a few days later.
IS overran large areas north and west of Baghdad in 2014, but Iraqi forces have since regained significant ground and are conducting operations to set the stage for the battle to recapture Mosul, the last IS-held city in the country.
The jihadists have responded to the battlefield setbacks by striking civilians, and experts have warned there may be more such attacks as the jihadists continue to lose ground.