It looked as though the hosts were on course for a second successive goalless draw in front of their own fans following another dreary display which failed to entertain a sparse Old Trafford crowd.
Indeed, Jose Mourinho's side needed David de Gea to pull off a remarkable save to keep the scores level in the second half before Fellaini struck at the death to bring a victorious end to an otherwise forgettable evening.
Mourinho made six changes to the side which could only manage a goalless stalemate with Crystal Palace at the weekend, with Paul Pogba and Romelu Lukaku among those dropped to the bench and notable returns to the starting lineup for out-of-favour duo Phil Jones and Antonio Valencia.
The changes appeared to work early on, too, as United made a bright start to the match, and one of those brought in should have opened the scoring inside five minutes when Marcus Rashford found himself clean through on goal, only to lift his finish over the crossbar with the goalkeeper stranded.
Fred tried his luck with a powerful rising drive which skimmed just over the crossbar moments later, before David von Ballmoos was called into his first save of the night to keep out Fellaini's deflected cross.
Young Boys did begin to settle into the occasion, though, and they held their own for most of the first half despite surrendering the lion's share of the possession.
The bulk of the chances continued to fall for the hosts, though, and Rashford tested Von Ballmoos again with a low drive from a tight angle after a rare piece of quick passing from United's attackers.
It was Rashford who looked most likely to break the deadlock, but he was not clinical enough in the final third and fired a dipping low drive narrowly wide of the target after 26 minutes having been found by Jesse Lingard's clever flick.
Another example of the home side's wastefulness arrived four minutes before half time when Rashford latched on to a wayward pass and raced down the left flank, only to put too much on his cutback to Fellaini as Fred instead collected the ball at the back post and curled an effort wide of the far post.
United were almost punished on the stroke of half time when Young Boys created their first clear chance of the contest, but Djibril Sow overelaborated his finish and flicked the ball wide of the near post when he may have been better off going for a more orthodox attempt.
Mourinho opted against making a half-time substitution despite having some big names in reserve, and little changed at the start of the second half with Young Boys creating the first sight of goal when Kevin Mbabu fired into the side-netting.
United responded with a period of pressure which yielded two good chances, but first Rashford sliced well wide of the near post before Fellaini ballooned his finish over the crossbar after a poor piece of goalkeeping had gifted the Belgian a good opening.
Lingard then stung the palms of Von Ballmoos for only United's second shot on target of the match, and Mourinho finally called upon the cavalry shortly after the hour mark as Pogba and Lukaku replaced Lingard and Fred.
Pogba made a quick impact by setting up another chance for Rashford to blast wide, but United needed another big name to rescue them 20 minutes from time when De Gea pulled off a stunning save to prevent his side from falling behind against their depleted visitors.
Christian Fassnacht's initial shot from the edge of the box did not look likely to cause many problems, but the ball took a deflection off Chris Smalling and then Mbabu before trickling towards goal. The Young Boys players were already wheeling away in celebration as the ball looked destined to cross the line, but De Gea somehow got across to claw it away.
An end-to-end period of the match ensued as Young Boys began to believe that they could steal a famous victory, with Sow drilling one free kick over before Lukaku failed to hit the target with a near-post header.
A deflected Luke Shaw strike then forced a routine save from Von Ballmoos, but again Young Boys were quickly up at the other end and Fassnacht put a promising opening high and wide from the edge of the box.
Mourinho had wanted to take Fellaini off for Juan Mata with his final change, but an injury to Valencia forced his withdrawal instead and the hosts soon went route one towards the towering Belgian, who teed up Mata for one sight of goal 10 minutes from time.
It looked increasingly as though United would fail to score in three successive home European games and fail to win in four for the first time in their history, but Fellaini popped up with the winner in the first minute of stoppage time to send those left inside Old Trafford wild.
Shaw's long ball forward was flicked on by Lukaku for Fellaini, who turned inside the area and drilled his finish on the turn into the bottom corner - although replays raised a suspicion of handball when he initially controlled it.
No-one inside Old Trafford was worried about that, though - least of all Mourinho, who celebrated the goal by picking up a whole crate of drinks and slamming them into the ground in a mixture of relief, euphoria and frustration at what had been another underwhelming evening prior to the late winner.
Nonetheless, United can now go into their final group game away to Valencia free of worry with five points separating them from the Spanish outfit, whereas Young Boys are now consigned to finish bottom of their first ever Champions League group stage.
MAN UTD (4-3-3): De Gea; Valencia (Mata 72'), Smalling, Jones, Shaw; Fred (Pogba 64'), Fellaini, Matic; Lingard (Lukaku 64'), Rashford, Martial
YOUNG BOYS (4-5-1): Von Ballmoos; Mbabu, Camara, Von Bergen (Garcia 46'), Benito; Sulejmani (Fassnacht 66'), Sow, Lauper, Aebischer, Assale; Nsame (Ngamaleu 83')body check tags ::