Hafner supplied three run-scoring singles, Lyle Overbay socked a solo homer and Eduardo Nunez contributed three hits and scored a run as the Yankees bounced back from a 9-1 loss in the first contest of their three-game series.
Chris Stewart went 2-for-4 with an RBI for New York, which banged out 15 hits in the victory.
Kuroda (4-1) stymied the Astros on four hits, overcoming four walks while striking out eight.
Mariano Rivera got the final out of the game for his 10th save after Houston had rallied for four runs against the Yankees bullpen.
Astros starter Phil Humber (0-6) was touched for four runs on nine hits over six full innings.
Chris Carter cracked a two-run homer and Jose Altuve knocked in a pair for the Astros.