The Swiss side took an early lead from the penalty spot but a strong United team, featuring several players who have been involved with the Under-23s so far this season, quickly drew level through Mason Greenwood’s emphatic finish.
Nicky Butt’s side were on top for large periods thereafter in Bern but looked set to be denied by some resilient Young Boys defending, only for Gomes’s late intervention after Brandon Williams had been upended inside the box.
The young Reds, like their first-team counterparts at the nearby Stade de Suisse, were playing on an artificial pitch at Sportpark Wyler and made a bright start in the Swiss sunshine.