England defender Maguire, who has faced intense criticism over recent months, headed what proved to be the winner in the 72nd minute to bring United back into contention in Group A with a 1-0 win.
There was a nervy finish at Old Trafford on Tuesday night, though, with under-fire goalkeeper Onana saving a Jordan Larsson penalty from what was the last kick of the game.
Harry Maguire (5) scores Manchester United's winner over Copenhagen at Old Trafford.
Bayern Munich control the group with maximum points after a competition record eighth straight win away from home in the group stage, 3-1 at Galatasaray.
England captain Harry Kane scored the second and set up the final goal for Jamal Musiala after Kingsley Coman opened the scoring for the German champions.
Kane now has 11 goals and six assists since moving to Bayern Munich in August from Ange Postecoglou's Tottenham.
"It's a really important win. This is a really tough place to come and they made things difficult for us," Kane told Prime Video.
Fourteen-times tournament winners Real Madrid have full points in Group C after winning 2-1 at Braga with the help of yet another Jude Bellingham strike - his 11th in 12 ECL and La Liga games this season.
Napoli remain second after handing Union Berlin a ninth straight defeat in all competitions, 1-0 in the German capital.
Gabriel Jesus superbly set up Gabriel Martinelli and then scored a stunner himself as Arsenal won 2-1 at Europa League champions Sevilla to go top in Group B.
Lens and PSV Eindhoven drew 1-1 in the group's other game on Tuesday.
Real Sociedad kept first place in Group D on goal difference over last season's runners-up Inter Milan, winning 1-0 at bottom side Benfica.
Inter held off Red Bull Salzburg 2-1 thanks to goals from Hakan Calhanoglu and veteran forward Alexis Sanchez.
There was lots of emotion at Old Trafford in the tribute to Charlton who had survived the 1958 Munich Air Disaster, scored 249 goals in 758 games for United and helped them win the first of three titles in Europe's premier club competition in 1968.
Emotions ran high at Old Trafford as Manchester United said farewell to club legend Bobby Charlton.
A lone bagpiper played as United manager Erik ten Hag, Charlton's former teammate Alex Stepney and the club's current under-19s captain Dan Gore laid a wreath on the halfway line before before a minute's silence was observed.
Another wreath was placed on Charlton's seat in the directors' box at the first home game since his death.
But the team struggled and it took 72 minutes until Maguire finally broke the deadlock from a Christian Eriksen's cross.
"It is incredible, a great night," Ten Hag told broadcaster TNT Sport.
"Especially in the dying seconds when you concede a penalty, but a brilliant save from Andre Onana.
"It was a narrow escape in the end."