Hot-shot Mario Gomez took his tally to 14 goals in his last 10 games as the Germans appeared to be cruising at the break.
But Marco Borriello, Danielle De Rossi and a late Francesco Totti penalty completed a remarkable and unlikely turnaround.
The 3-2 defeat still ensured Bayern won the group as only Roma can draw level with them on points in Group E but the Germans have the better head-to-head record.
Roma now need only a point away to CFR Cluj in two weeks to book their passage into the second round.
It left coach Claudio Ranieri in positive spirits.
"It was important to get points tonight, we got three against the vice-champions of Europe, it wasn't easy, especially in the first half but the players were magnificent," said Ranieri.
Bayern's Dutch coach Louis van Gaal slammed his players for throwing away another game.
"We played a great first half, we dominated but then it was incredible how we brought Roma back into the match in the second half," he said.
"Ranieri changed their system from a 4-4-2 to a 4-3-3 but that wasn't the problem.
"The problem was we lost too many balls and gave away too many chances to Roma.
"We've thrown away a game again, like we did against (Borussia) Moenchengladbach and (Bayer) Leverkusen and we have to find a way to stop doing that."
The hosts almost got themselves into a fix in the opening exchanges as Philippe Mexes's awful back pass put goalkeeper Julio Sergio under pressure and his clearance went straight to Franck Ribery but somehow escaped through the winger's legs.
The hosts had a half chance on three minutes as Borriello took a throw-in, turned and volleyed goalwards with Thomas Kraft parrying and Jeremy Menez blazing wastefully high with the follow-up.
Roma were well in the game at this point and a splendid half-volley from 25 yards by Leandro Greco stung Kraft's fingers before Vucinic again blazed the follow-up into row Z.
Matteo Brighi teed up Menez on 29 minutes but the Frenchman didn't get hold of his shot and it was deflected into Kraft's grateful arms.
The breakthrough came on 34 minutes with a brilliantly worked goal.
After exchanging passes with captain Philipp Lahm, Toni Kroos slipped the ball into Ribery who turned on a sixpence and crossed for Gomez to beat Marco Cassetti to the ball and scuff it into the corner.
Five minutes later a misplaced pass from Menez to De Rossi was intercepted by Thomas Mueller, who fed Gomez to shoot across Sergio to double the lead.
Roma's response after the restart was immediate, thanks in no small part to a tactical switch from Ranieri, who moved Menez and Vucinic onto the flanks.
Menez skinned Anatoliy Tymoshchuk and Martin Demichelis and crossed for Borriello, who fell as he controlled the ball but from the deck still managed to flick the ball past Kraft.
"Bayern make you run a lot, that's why in the second half I put Vucinic left and Menez right, then we managed to create problems on the flanks," explained Ranieri.
Roma should have been level on 61 minutes after the increasingly menacing Menez hit the byline again and crossed into the danger zone but Kraft clawed Simplicio's dig off the line and then blocked Brighi's follow-up with his knees.
Roma got the equaliser nine minutes from time with another beautifully worked goal as Vucinic played John-Arne Riise in behind the backline and he fizzed the ball across the box for De Rossi arriving at the back post to slam home.
Borriello then won a race with Kraft who clattered into him and Totti, just on as a substitute, despatched the spot-kick.