The Astros, who had scored 20 runs in their previous three games, failed to bring one runner home and could not make a routine play in the field that proved to be costly.
Detroit’s Nick Castellanos reached in the seventh inning because first baseman Marc Krauss dropped a perfect throw from third baseman Matt Dominguez and ended up scoring the game’s first run when Rajai Davis hit an RBI single.
“I just took my eye off the ball,” Krauss said. “That was a pretty bad time to do something like that because Cosart was pitching his guts out against one of the best teams in baseball, and I handed them another out in a key situation.
“I feel horrible because I cost him a great shot at a win,” he said.
Cosart (1-3) allowed four hits in seven innings.
“I wanted to make sure that as a team, we don’t lose sight of that,” Porter said.
Scherzer (4-1) earned his fourth straight win. The reigning Cy Young Award winner has struck out at least seven in each of his seven starts this season, the only pitcher to pull off that feat in franchise history and the first for any team since San Francisco’s Tim Lincecum in 2010.
“He’s a Cy Young winner for a reason, but Jarred matched him pitch for pitch,” Porter said. “That was a great performance, but we couldn’t get him a win.”
Joe Nathan pitched the ninth for his sixth save in eight chances.
Nathan walked Dexter Fowler to lead off the inning. Fowler tried to advance on a pitch in the dirt and was thrown out by Alex Avila, a call that stood after a video review.