Brazilian-born German international Cacau headed the mid-table Bundesliga team in front in the 25th minute as they outplayed the visitors in a pulsating first half.
Stuttgart had chances to increase their lead as they put the champions on the back foot but Lionel Messi also hit the post for Barca just before halftime.
Barca levelled in the 52nd minute when Ibrahimovic scored at the second attempt after his first shot was superbly saved by Jens Lehmann.
"We have to do better, play the way we are capable of, but don't forget that in European competition you are facing very good teams," said Barca coach Pep Guardiola.
"Europe is very tough, very difficult and very demanding," he added.
The first chance of the game fell to Messi, who had a shot blocked by Serdar Tasci after he burst through the middle.
Cacau, who scored four goals in a 5-1 win at Cologne on Saturday, then put Stuttgart ahead when he outjumped Carles Puyol at the far post to nod in Timo Gebhart's cross.
HANDLING OFFENCE
The Germans appealed for a penalty for a handling offence by Gerard Pique before Cacau had a toe-poked shot blocked by keeper Victor Valdes.
In another home attack Christian Traesch should have done better when he shot wide from Aleksandr Hleb's layoff.
Stuttgart then had a let-off when Lehmann allowed a Messi shot to slip through his hands, only for the ball to hit the post and bounce into the arms of the grateful keeper.
Barca were on target soon after the restart when a Pique header found Ibrahimovic and he converted from close range at the second attempt.
The Sweden striker almost grabbed a winner when his shot was deflected over by a defender after Lehmann completely missed a corner.
Stuttgart coach Christian Gross was frustrated his side were only 1-0 up at halftime.
"I think we could have had another goal but things changed in the second half," said Gross.
"They (Barca) didn't create so many chances.
"It was a great first half but we couldn't keep it up for the second. Not many teams take points off Barcelona so this makes me happy," he added.
Four-star Cacau hands Cologne a mauling
Barca taste season's first defeat, Deportivo lose
Messi, Ronaldo in race for Ballon d'Or award
Leverkusen squander chance to go clear at top
La Liga: Barca thrash Racing 4-0