Open this photo in gallery:

Jose Berrios of the Toronto Blue Jays pitches against the Houston Astros during the first inning of their MLB game, on Wednesday.Mark Blinch/Getty Images

For a second straight night, the Toronto Blue Jays staged a thrilling late-game comeback against the Houston Astros.

Tuesday’s resulted in a rousing victory. Wednesday’s ended in a crushing 3-2 Toronto loss.

The Jays tied up the game 2-2 in an exciting eighth inning, only to then have Yainer Diaz crack a Jeff Hoffman fastball over the fence for Houston’s eventual game-winner.

Jose Berrios allowed five hits, two runs and struck out four through five and a third innings of work for Toronto. It was much better than his previous outing a week earlier in Cincinnati, when Berrios allowed six runs (two earned) in a season-low two innings.

Jays manager John Schneider was “encouraged” with the performance from Berrios, thought his fastball was improved as well as his tempo, delivery and his curveball.

“That’s what we’re looking for out of Jose,” said Schneider.

It remains to be seen what the outing means for Berrios, whose place in Toronto’s pitching rotation remains unclear as the postseason nears. Two years ago, he was the No. 2 starter for the Jays in the postseason. This year, it’s yet to be settled.

Bichette put on Blue Jays’ 10-day injured list with left knee sprain

Every day sees Toronto playing meaningful September baseball. The race to a potential playoff berth continues for the Jays, as they still have 17 games left in the regular season.

With Wednesday’s loss, the Jays (83-62) remain three games ahead of the New York Yankees in the American League East. The Yankees also lost Wednesday, to the Detroit Tigers.

Toronto’s loss came a night after the Jays walked off the Astros 4-3 in 10 innings Tuesday night in their 43rd comeback win of the season.

Diaz also got Houston on the board first on Wednesday when he doubled off Berrios in the second inning on a sharp fly ball to right field that scored Jesús Sánchez.

There was little action until Carlos Correa took a Berrios changeup deep over the left field wall in the sixth inning to give the Astros a 2-0 lead. That was the last batter for Berrios.

Open this photo in gallery:

Yainer Diaz of the Houston Astros celebrates his home run with Jose Altuve against the Toronto Blue Jays during the ninth inning in their MLB game, on Wednesday.Mark Blinch/Getty Images

The 36,760 attendance were waiting to experience some of the magic the Jays had weaved late the night before, when they were no-hit by Houston through five innings and fell behind 3-0 before rallying back to win. The Jays had all spilled onto the field that night to celebrate with Tyler Heineman, whose walk-off RBI had sealed the victory.

Houston’s Wednesday starter Jason Alexander had a solid outing, allowing the Jays just three hits and one walk in seven shutout innings. He struck out three before he left the game.

All the excitement began for Toronto’s bats in the eighth inning.

It looked as if the Jays had their moment early in the inning when Ernie Clement cracked a long ball just a hair shy of being a game-tying homer – a ball so narrowly foul it needed video review to rule out.

Opinion: Blue Jays head into the Bronx with a chance to make a statement

Then Isiah Kiner-Falefa was a difference-maker for the second straight night, when he entered the game in the eighth inning and singled to get things cooking for Toronto.

Tyler France then singled to advance him, and Andrés Giménez singled on a ground ball to bring Kiner-Falefa home.

Then Nathan Lukes cracked a line drive through the infield to bring pinch-runner Myles Straw home as the crowd erupted at the tied game.

But then Hoffman gave up the homer to Diaz in the ninth. That’s 15 homers allowed by Hoffman, the most of any reliever in the major league baseball this season.

“He’s got good stuff, you know, I still trust him,” said Schneider of Hoffman. “He’s throwing the ball really well. It was one bad pitch tonight.”

The Jays could not rally back in the ninth inning with any runs.

The Jays were without hard-slugging shortstop Bo Bichette for a third straight game, as the team placed him on the 10-day injured list with a left knee sprain, retroactive to Sept. 7.

The series closer against Houston is Thursday afternoon at the Rogers Centre, before the Jays welcome the Baltimore Orioles for a three-game set starting Friday.

Kevin Gausman takes the mound for Toronto.