The officials say those killed in the today afternoon attack in the northern Baghdad district of Tarmiyah included the post's commander, a major, and two other officers, a captain and lieutenant.
The officials spoke on condition of anonymity because they were not authorized to speak to the media.
There was no immediate claim of responsibility for the attack, but it bore the hallmarks of militant Sunnis from the Islamic State group, an al-Qaida breakaway that has seized control of about a third of the country.