HOUSTON — Evan Gattis knows he probably shouldn’t have taken a swing at a shoulder-high pitch from Tampa Bay closer Alex Colome in the ninth inning on Friday night.

Considering what happened next, he’s glad he did.

Carlos Correa and Gattis hit back-to-back homers in the ninth inning to lift the Houston Astros to a 5-4 victory over the Tampa Bay Rays.

“I tried not to swing at that pitch,” Gattis said. “But it worked out good.”

Mikie Mahtook’s first homer this season, a towering shot with two outs in the ninth inning, had put the Rays on top before Houston’s dramatic comeback.

Correa connected on the first pitch in the ninth inning from Colome (1-4) on a home run to the seats in right field to tie it 4-4.

Gattis then fought through eight pitches before sending the ninth to right field for his 21st homer that gave Houston the win.

“He had one of the best at-bats of the night, not because he hit the homer but how he got there,” manager A.J. Hinch said. “I’m not even sure the home run was a strike, it might have been neck high for all I know. There was a calmness to him as well being able to take those pitches.”

He bounded through the celebration at home plate before ripping off his jersey Superman-style and continuing the celebration bare-chested.

“Embarrassing,” he said of his celebration. “But whatever. A little out of character.”

Colome’s tough night ended a stretch of 11 straight scoreless appearances. It was just his second blown save of the season and the first time he had given up a run since his other blown save on July 23 against Oakland.

“It was just one of those nights. All the great closers have them,” manager Kevin Cash said. “Hopefully, he gets an opportunity to go back out there tomorrow. When he gets the ball and we have a lead, we couldn’t feel any more confident that we’re going to have success.”

Corey Dickerson hit a career-high three doubles, drove in a run and scored twice on wild pitches to help Tampa Bay come back from an early 3-0 deficit.

The game was tied 3-3 with two outs in the ninth when Mahtook sent a pitch from reliever Ken Giles (2-3) onto the train tracks atop left field.

Jake Marisnick homered in the second inning to help Houston build an early lead.

Rays starter Drew Smyly allowed three hits and three runs — two earned — while striking out eight in six innings.

Houston’s Mike Fiers yielded six hits and three runs in 6 1/3 innings.

Jose Altuve drove in a run on a force out in the first. He then went from first to third on an error by first baseman Brad Miller when he missed the throw on a pickoff attempt. The Astros took a 2-0 lead when Altuve scored on a single by Gattis with one out.

Marisnick’s homer with one out in the second extended Houston’s lead to 3-0.

Smyly settled in after that, retiring the next 14 batters. The Astros didn’t have another baserunner until Yulieski Gurriel singled off Kevin Jepsen with no outs in the seventh.

Dickerson doubled in the third inning and took third on a wild pitch with two outs. The Rays cut the lead to 3-1 when Dickerson scored on another wild pitch.

Dickerson opened the fifth inning with another double and advanced to third on a sacrifice bunt by Bobby Wilson. After that, another pitch got away from Fiers and Dickerson scored for the second time on a wild pitch to get Tampa Bay within 3-2.

Dickerson’s third double of the night came with one out in the seventh to drive in a run and tie it 3-3.

TRAINER’S ROOM

Rays: 2B Nick Franklin played in a rehab game at Class-A Charlotte on Friday night and was activated from the seven-day concussion list after the game.

Astros: OF Colby Rasmus worked out on the field on Friday for the first time since having surgery to remove a cyst in his ear on Aug. 10. Rasmus said he’s finally starting to feel normal again, but isn’t sure when he’ll come off the DL.

JENNINGS TO BE RELEASED

The Rays will release OF Desmond Jennings on Saturday. The team announced the impending move before Friday’s game.

“It was time,” Cash said. “Best for him. Best for us going forward … unfortunately it just didn’t work out. Couldn’t quite get him on the field as much as we would have liked. We had to make a decision.”

Jennings has been on the DL with hamstring and knee injuries for all but five days since July 4. He is currently on the 15-day DL with a bruised left knee.

UP NEXT

Rays: Blake Snell (4-6, 3.17) is scheduled to start for Tampa Bay on Saturday. Snell has struggled with control in his last three starts, walking 13 batters in that span, including a career-high five in his last outing.

Astros: Dallas Keuchel (8-12, 4.64) will start for Houston on Saturday. Last year’s AL Cy Young Award winner allowed five hits and two runs in eight innings of a 5-3 win over Baltimore in his last start.