Houston had been playing well coming into the game, but it could not compete against the Galaxy and the California crowd.
Calen Carr started the scoring for Houston with a goal just before the end of the first half in the 44th minute.
He ran past Tommy Meyer and put the ball in the back of the net after an assist from Adam Moffat.
The Galaxy then got an equalizer from Omar Gonzalez, as the defender put in a header in the 60th minute.
Landon Donovan then put Los Angeles in front with a penalty kick only five minutes later.
Although Houston had some chances, it was not able to come out on top. A Robbie Keane penalty kick sealed the win in extra time.
Despite the fact that these two sides met in last year's MLS Cup, neither team was expected to be in the league's title match.
Houston ended the MLS regular season as the No. 5 team in the Eastern Conference. At 53 points, the club was 10 points behind Kansas City for the division lead.
Los Angeles was even further back of San Jose for the top spot in the Western Conference.
However, both squads survived the knockout stage and kept going in the MLS Cup playoffs until they reached the final game.
The Galaxy remain one of the top programs in MLS with great talent and elite star power. That will be a little less after this game with David Beckham leaving town, as the 37-year-old star announced last month that he will move on to another league after five years in the MLS, according to Kevin Palmer of ESPN.
Overall, this was a great finish to a great year for Major League Soccer.
Calen Carr scores for Houston in the 44th minute.
Omar Gonzalez evens up the game with a header.
View from the stands of Landon Donovan getting his fifth career MLS Cup goal on a penalty kick.
Omar Gonzalez, Los Angeles: A+
The elite defender made himself known on the offensive end in the game.
He was able to tie the game on an impressive header, but he was also the reason that a goal was called back later on.
Still, he was solid on defense like he always is and was a big reason for the victory. This ability helped earn him the game's MVP award.
Landon Donovan, Los Angeles: A-
Despite his age, Donovan is still arguably the best that America has to offer in this sport.
He not only easily finished a penalty shot, but he was aggressive throughout the game. Donovan led the team with three shots, and even his offsides forced Houston to make adjustments.
The Team USA leader deservedly earned this trophy.
Brad Davis, Houston: D
The midfielder did not do too much to help his team in this one.
Brad Davis was almost non-existent on the offensive end, and he only helped Los Angeles on the defensive side by committing four fouls.
The veteran is usually a big part of the team's success, but he did provide a positive result in this one.
Calen Carr, Houston: B
At times, it seemed like Calen Carr was the only person trying for the Dynamo.
While top scorer Will Bruin was kept silent, Carr put two shots on net and constantly put pressure on the opposing defense. He played well enough for his team to win if he had some support.