Magee gives Galaxy advantage over Red Bulls
The game ended in acrimony with post-match scuffles on the field, which resulted in two red cards and will ensure a spicy second leg in California.
Beckham, searching for his first MLS title in his fifth year in the league, floated a high ball into the New York penalty area and Magee took advantage of static Red Bulls defenders, arms raised appealing for offside, to blast home.
The Galaxy goal came after their Ireland international striker Robbie Keane hit the post and they enjoyed the better of the game playing some neat possession football.
New York, with former Arsenal and France striker Thierry Henry in attack, left it late to pile on the pressure but L.A. held firm.
The Galaxy were helped by some good saves from keeper Josh Saunders, who denied Joel Lindpere at close-range and then pulled off a great stop in injury time to foil Mexican Rafa Marquez.
Marquez and Galaxy's Juninho will miss the second leg after being given red cards for their part in a fracas after the final whistle, where punches were thrown.
The Mexican lobbed the ball at Donovan, albeit striking only his leg, which prompted the set-to. Brazilian Juninho was adjudged to have struck Red Bull's Stephen Keel in the mouth.
The Philadelphia Union's first game in the post-season ended in defeat to an impressive Houston Dynamo.
The first leg of the Eastern Conference semi got off to a crackling start when Canadian Andre Hainault headed in a Brad Davis cross to put Dynamo in front.
French forward Sebastien Le Toux responded for the Union within 90 seconds with a close-range, left-foot finish after good work from Michael Farfan.
Dynamo got back in front on the half hour when Calen Carr produced a cool finish after being put through by a smart pass from former U.S. international Brian Ching.
There were chances for both teams in a hard-fought second half but Houston will be delighted to take a 2-1 lead back to Robertson Stadium for Thursday's second leg.
Sporting Kansas City enjoyed a 2-0 win at defending champions Colorado Rapids in the Eastern Conference thanks to two goals from striker Teal Bunbury.
Bunbury's second goal came from the penalty spot after he was ruled to have been brought down by Tyrone Marshall and the Jamaican defender was sent off.
Real Salt Lake beat the Seattle Sounders 3-0 in the Western Conference on Friday.