The Astros were down to their last strike in the top of the ninth against Pirates closer Joel Hanrahan (4-0), when Jason Castro lined a pinch-hit double down the right-field line, scoring Jed Lowrie with the tying run.
Houston's Wesley Wright (0-2) retired Gorkys Hernandez to start the next half inning, but Sutton then connected on a long homer to center field, handing the Pirates their sixth win in seven games.
Andrew McCutchen went 3-for-4 with a two-run clout while Garrett Jones also supplied a two-run shot for the second-place Pirates, who came into the contest trailing National League Central-leading Cincinnati by one game.
The win put Pittsburgh eight games over .500 (44-36) for the first time since 1992.
Lowrie and Jordan Schafer each provided two hits and a pair of RBI for Houston, which dropped its sixth straight.