"The Tunisian president received the young woman raped by the policemen... and after listening to the details of this painful case... he expressed total sympathy (with the woman) and offered a state apology," a statement said.
Marzouki also "strongly" condemned the rape and hailed the police agents who refused to cover up for their colleagues, something which he said demonstrated that the problem "is not the security institution itself but the mentality of some of its members."
"There is no more tolerance, neither for rapists, nor for those... who want to hide the truth," the statement said.
"The presidency will follow this case closely to ensure that no partisan interest is brought to bear on the rule of law, and so that Tunisians have their rights restored," it added.
The 27-year-old rape victim faces possible indecency charges with her fiance based on the testimony of the alleged rapists, policemen who say they took the couple by surprise in an "immoral position" just before the attack purportedly took place.
Magistrate Mohamed Ben Meftah is due to decide whether the woman and her fiance should be charged, after questioning them for more than two hours on Tuesday.
The case has sparked a storm of protest in Tunisia, with NGOs, media and opposition figures saying the proceedings have transformed the victim into the accused and reflect the Islamist-led government's policy towards women.
Prime Minister Hamadi Jebali, from the ruling Islamist party Ennahda, said earlier this week that the policemen, arrested shortly after the incident and now awaiting trial, would be "severely judged."
But he also said there may be a case of indecency to answer.