TORONTO (AP) -- All too often this season, the Houston Astros have seen potential victories slip through their fingers.
On Saturday, they held on to one.
Chris Carter hit a three-run homer, Justin Maxwell and Matt Dominguez added consecutive shots and the Astros beat the Toronto Blue Jays 8-6 to snap a three-game losing streak.
"It's always good to get a win and get that positive vibe going again," Carter said.
Dallas Keuchel (5-5) pitched a season-high 7 1-3 innings to end a six-start winless skid. He allowed six runs and 10 hits, walked one and struck out six for his first victory since June 16.
"It was a good win for a ballclub that obviously has played well but not well enough to get over the hump," Astros manager Bo Porter said. "Today we played well enough to get over the hump."
Jose Veras got the final five outs for his 19th save in 22 chances as Houston rebounded from Friday's 12-6 loss, a defeat that saw the bullpen surrender eight runs.
"It's always nice to bounce back," Carter said.
The Astros, who had lost 21 of their previous 26, won for just the second time since July 12.
"We need every win that we can get," Porter said. "Just looking at the last few games, and we were in position to win several of them and were not able to come out on the winning side. It was good to get a good performance."
Houston second baseman Jose Altuve left in the seventh with a sore left quadriceps and was replaced by Jake Elmore. Altuve was examined by the trainer after pulling up while going from first to third in the first inning, but did not immediately leave the game.
"When I tried to go from first to third it just tightened up a little bit, but it's OK," Altuve said.
Porter called the injury "mild" and said Altuve could have finished the game if necessary.
"I was actually going to give him a day off tomorrow anyway," Porter said, "so it made much more sense to just go ahead and get him out."
Jose Bautista hit a three-run homer, Mark DeRosa hit his 100th career home run and Colby Rasmus also connected for Toronto, but it wasn't enough as the Blue Jays lost for the eighth time in 10 games.
"Dallas did a great job," Porter said. "Early on his pitch count started to get up there but he did a great job in the last three innings of minimizing it and really getting on the attack and forcing them to swing the bat."
Maxwell and Dominguez went back-to-back in the fourth, the third time this season the Astros have hit consecutive home runs.
All three Astros homers came off Josh Johnson, who lost his career-worst fifth straight start.
"He's scuffling, that's an understatement," manager John Gibbons said.
Johnson (1-7) came in 0-4 with a 7.71 ERA in five starts since defeating the Orioles on June 23. He'd lasted just two innings in his previous outing, allowing five runs and seven hits against the Los Angeles Dodgers in a performance he described as "pitiful."
The struggling right-hander was immediately in trouble against Houston, which has the worst record in the majors, surrendering four runs before recording his first out.
Jonathan Villar hit a leadoff single, went to third on Altuve's base hit and scored on a single by Jason Castro.
Carter hit Johnson's next pitch into the batter's eye in center for his 19th homer this season.
"I was just looking for anything I could drive early in the count, not get behind and give him a chance to throw his pitches," Carter said.
Edwin Encarnacion got Toronto on the board with an RBI single in the bottom half, and DeRosa homered on the first pitch of the second.
The Astros made it 6-2 when Maxwell and Dominguez hit one-out homers in the fourth. Maxwell's home run was his second, and his first since April 12. For Dominguez, the homer was his 13th.
Toronto pitchers have surrendered back-to-back homers on eight occasions this season, and have allowed 14 multihomer innings.
Rasmus hit a leadoff drive in the fifth but Maxwell made it 7-3 in the sixth when he was hit by a pitch, stole second and scored on Dominguez's two-out single.
That was it for Johnson, who matched a season-worst by allowing seven runs and seven hits in 5 2-3 innings. He walked two and struck out eight.