Puig scored to give the Galaxy a 2-1 lead in the 59th minute. Pec tapped a cross to Puig at the top of the area for the put away from 15 yards out.
The Galaxy (6-2-7) are unbeaten in five consecutive games.
Goalkeeper John McCarthy tried to play a clearance, but Latif Blessing stole it and rolled the ball into a wide-open net to give Houston a 1-0 lead in the 18th minute.
Pec, a 23-year-old rookie, scored his fourth goal of the season to make it 1-1 just before halftime. Miki Yamane, on the right side, cut back to evade a defender and then, at the edge of the box, chipped an entry to the center of the area where Pec flicked a header inside the back post in the 44th minute.
Andrew Tarbell had four saves for the Dynamo.
McCarthy stopped three shots for the Galaxy.
Houston (5-6-3) has scored multiple goals in just three games this season, all of which were 2-1 victories. The Dynamo’s 13 goals this season are second fewest in MLS, behind the New England Revolution (nine).