She said the commandos accused her of cooking for Sunni fighters and took her to a police garrison where the attack occurred.
"One of them put his hand on my mouth so no one outside the room could hear me," she said in an AP videotape. "I told them 'I did not know that an Iraqi could do this to another Iraqi'."
She said a neighbour alerted US soldiers about the arrest and they released her after the attack.
Lieutenant-Colonel Christopher Garver, a US spokesman, said he could not confirm any US role in her release but that the military "will support the Iraqi government in its investigation".
The allegations are potentially explosive at a time of rising tensions between Shias and Sunnis as the US begins a security operation to restore order in the capital.
Sunni leaders have been claiming the crackdown has focused on their neighbourhoods while leaving some Shia-led strongholds largely unaffected.
Sunnis routinely accuse the Shia-dominated security forces of using excessive force against them, including indiscriminate arrests and torture of prisoners.
The victim did not specify that her attackers were Shias, although they form the majority within the ranks of Baghdad police, especially elite commando units.
Hussein Ali Kamal, Iraq's deputy interior minister, disputed the allegation, saying "something like this could not happen because Iraqi forces are operating with US forces at all times".
On the other hand, Mahmoud al-Mashhadani, a top Sunni official and parliament speaker, said on Al-Jazeera, referring to al-Maliki: "By God, if you don't bring justice to this Muslim Iraqi woman, whom you should view as your sister or daughter ... history will curse us with eternal disgrace."
Rape victims rarely come forward because they fear public scorn and humiliation.
A woman who acknowledges being raped risks death at the hands of male relatives seeking to restore their family's honour.