"That was a pretty rewarding win for this team," Astros manager A.J.Hinch said.
Carlos Beltran opened the 10th by drawing a walk from Ryan Garton (0-1) and went to second on Jose Altuve's single. After reaching third on Carlos Correa's fly to center, Beltran scored to make it 5-4 on McCann's hit to right.
Gurriel's two-out single put Houston ahead 6-4.
The Astros tied it at 4 on pinch-hitter Evan Gattis' sacrifice fly off closer Alex Colome, who was bidding for a two-inning save, in the ninth.
"The beauty of this team is we're so deep," McCann said. "The bottom of the order can get you, the top of the order can get you."
Houston, which won two of three, hadn't won a road series against Tampa Bay since June 2008.
"We let one get away from us," Rays manager Kevin Cash said. "Frustrating loss."
After Correa had two-run shot during the third, Altuve got Houston within 4-3 on a solo homer in the fifth.
Joe Musgrove gave up four runs and five hits -- all in the first -- over six innings for the Astros. He allowed just two baserunners -- on catcher's interference and a walk -- from two outs in the first through the sixth.
"When you get punched in the mouth, you've got to get up and punch back," Musgrove said.
Three Houston relievers held the Rays to two hits.
Tampa Bay's Matt Andriese allowed three runs and six hits in five innings.
Astros center field Jake Marisnick was replaced defensively to start the bottom of the third due to concussion-like symptoms. He had remained in the game after running face first into the center-field fence while catching Logan Morrison's first-inning drive.
Astros: OF George Springer had his major-league leading streak of playing in 205 consecutive games end because of left hamstring discomfort. He was hurt running out a grounder Saturday and is day to day. "It's a bummer for him, and I was proud of him because at the beginning of his career he had to answer so many questions about his injuries," Hinch said. "And then last season he played in every game."
Rays: CF Kevin Kiermaier, who left both Friday and Saturday's games due to illness, entered as a defensive replacement in the eighth. ... RHP Tommy Hunter (right calf strain) was placed on the 10-day disabled list and RHP Chih-Wei Hu was recalled from Triple-A Durham.
Correa went 1 for 5, and has one hit in 14 at-bats over four games after missing three with a bruised right hand.
Astros: LHP Dallas Keuchel (3-0) takes the hill Tuesday night against Cleveland RHP Josh Tomlin (1-2). Keuchel has opened the season with four straight starts of seven innings, while allowing one or fewer runs in each outing. Only one other Astros pitcher, RHP Roger Clemens in 2005, has done it.
Rays: RHP Chris Archer (2-0) will face Baltimore RHP Ubaldo Jimenez (1-0) Monday night as Tampa Bay starts a three-city, eight-game road trip. The Rays are 1-6 on the road, compared to 9-4 at home.
Archer and Baltimore CF Adam Jones both played for the U.S. in the World Baseball Classic.
"He's a superstar in this game, but he really cares about other people as much as he cares about himself," Archer said.