Harrison, the next batter, served a single to left and Barmes beat the throw home for the winning run, which gave the Pirates the rubber match of a three-game series at PNC Park.
Tony Watson (3-0) picked up the victory with a scoreless top of the 12th.
Bucs starter A.J. Burnett yielded two runs on six hits in an eight-inning performance, issuing no walks and striking out four.
Wandy Rodriguez pitched well but got a no-decision for Houston, surrendering only one run on three hits over eight frames while fanning seven.
Millions of Getty images now available for free via embed tool
NBC reportedly holds celebs hostage to Jimmy Fallon's show