Teenage Hadebe and Darwin Quintero also scored goals for the Dynamo (3-1-2, 11 points), while goalkeeper Steve Clark made three saves. Houston won consecutive games for the first time since a three-game winning streak Aug. 25-Sept. 5 2020.
The Dynamo have earned points in four-consecutive games after they were shut out in the first two games of the season.
-Don't have ESPN? Get instant access
Jeremy Ebobisse scored a pair of goals in a three-minute stretch of the first half for the Earthquakes (0-4-2), while JT Marcinkowski made three saves. San Jose lost its sixth consecutive game at Houston.
Ferreira's opening goal came just eight minutes into the game on a right-footed shot off a corner kick from Adam Lundqvist.
The Earthquakes erupted for the lead, getting the tying goal from Ebobisse in the 25th minute off a tight pass inside the penalty area from Cade Cowell. Ebobisse scored with his left foot.
In the 28th minute, Ebobisee was at it again, heading home a long centering pass from Jan Gregus. It was Ebobisee's third goal of the season, all in the past two games.
The Dynamo got even at 2-all just before halftime when Quintero scored off a long rebound of a Marcinkowski save for his fourth of the season.
The Dynamo took the lead for good 3-2 in the 57th minute when Hadebe pounced on a loose ball in front after a Houston corner kick. Ferreira, who joined the club in January after a transfer from Club Libertad in Paraguay, scored his second goal in the 68th minute.
The Earthquakes managed to make things interesting when substitute Tommy Thompson scored in the 77th minute, just the defender's fifth goal in nine seasons with San Jose.