The visitors pressed in the early stages and almost took the lead when Andres Escobar raided forward to the edge of the box, but his powerful strike went just past the post.
Los Angeles should have gone ahead in the 26th minute when they broke upfield on a counter-attack as Landon Donovan saw his effort saved. Gyasi Zardes had a golden chance to score on the rebound, but he put his shot over the bar from close range.
Zardes caused problems again from a free kick as he rose highest in the area to head Donovan's cross at goal, although his attempt went just over the bar.
In the second half, Dallas took the lead against the run of play as Escobar whipped a cross to the back post and Blas Perez outjumped Dan Gargan to direct his header past Jaime Penedo into the top corner.
The Galaxy got themselves level in the 68th minute when Victor Ulloa was robbed in the box by Zardes as he attempted to clear Gargan's cross. Zardes teed up Robbie Keane and the Irishman fired his shot past Raul Fernandez.
Both sides looked dangerous in the final third as they looked to find a winner late in the game at the StubHub Center.
It was Los Angeles who secured the victory as Keane produced a moment of magic to beat a defender down the left wing and lift a pinpoint cross into the six-yard box for Gordon to attack and head past Fernandez into the net.