The bombing, which struck near a checkpoint in the Kadhimiyah area, home to a major Shiite 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 Shiite Muslim majority, whom it considers heretics.
An IS suicide bomber struck shoppers in Baghdad's central Karrada district earlier this month, killing 292 people.
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.