The Bundesliga side were appearing in the group stages of the Champions League for the first time in their history, and they looked on course for a famous point at the home of the 14-time champions when the clock ticked into the final minute of stoppage time with the scores still goalless.
However, Bellingham popped up with an opportunistic tap-in from close range to steal all three points for Madrid with his sixth goal in as many games since joining the Spanish giants in the summer.
Carlo Ancelotti's side struggled to create any clear openings in a low-key first half, with Union Berlin's defence - led by Leonardo Bonucci on his first appearance for the club - holding firm.
The hosts began to step things up in the second half, though, and a flurry of chances in quick succession saw Rodrygo first denied by goalkeeper Frederik Ronnow and then by the post moments later, crashing a half-volley against the upright.
Joselu also threatened for Madrid, including striking the woodwork himself, while Luka Modric saw a long-range thunderbolt tipped over the crossbar.
It looked as though Union had done enough to get off the mark at the first time of asking - and arguably in their toughest match on paper in Group C - only for Bellingham to break their hearts in the 94th minute.
There was no small element of fortune about the goal too, with Federico Valverde's low shot from the edge of the area ricocheting into the six-yard box, where two Madrid players were waiting to tap it into the unguarded net.
It was no surprise to see Bellingham get the final touch as he kept up his goal-a-game ratio at Madrid in his first Champions League outing for the club, further sealing his rapid rise to the status of Los Blancos' newest hero.
The result means that Ancelotti's men extend their 100% start to the season in all competitions ahead of the Madrid derby against Atletico at the weekend, while Union Berlin have now suffered three successive defeats.