Houston got the decisive tally in the 57th. Hainault's header from the right side of the six-yard box found the net after a corner kick and Houston held on to win a rematch of the 2011 MLS Cup.
The Dynamo ran their unbeaten streak to four games.
The defending MLS champion Galaxy (3-8-2), meanwhile, stretched their own winless skid to seven straight contests.
Edson Buddle scored for Los Angeles.
Benedict Cumberbatch's dramatic reading of R. Kelly lyrics is just what you need
Gal Gadot cast as Wonder Woman for 'Batman vs. Superman'