TORONTO - Significant cracks are forming in the Toronto Blue Jays' bullpen and the timing couldn't be worse.

Reliever Jason Grilli gave up a solo shot to Mark Trumbo in the eighth inning and closer Roberto Osuna allowed a two-run homer to Hyun Soo Kim in the ninth as Baltimore came back to edge Toronto 3-2 on Wednesday night.

The loss left the Blue Jays (87-71) clinging to a one-game lead over the Orioles (86-72) for the first wild-card spot and makes Thursday's series finale even more important.

"It was two good teams battling," said Toronto manager John Gibbons. "It came down to the end. They got the big home run there. Two teams with a lot at stake and they came up with the big blow."

With reliever Joaquin Benoit out for at least two weeks with a torn calf, Grilli and Osuna (3-3) are under even more pressure late in games. But Grilli was touched up in a loss to New York on Monday, a day after Osuna's blown save nearly resulted in another defeat.

Gibbons used his bullpen frequently earlier this month when the team was struggling. Fatigue may be becoming a significant issue.

"There is a lot that goes into this and this is the time when it's the hardest," Grilli said. "You dig down deep and you go on pure adrenalin and pure guts. You try to make pitches, you try to give your all and that's what's happening.

"We're doing that. The effort hasn't changed."

In the eighth, Trumbo belted a 1-0 pitch for his major league-leading 46th home run of the season. The towering blast landed in the second level of seats beside the left-field foul pole.

Kim, who came on in the ninth as a pinch-hitter after Jonathan Schoop's one-out single, took the ninth pitch of his at-bat just over the wall in right field. It was his sixth homer of the season.

"I think that's what it's all about," Trumbo said of Kim's go-ahead blast. "I think everyone in the dugout was going nuts. Obviously that was a really hard-fought win."

The homer silenced the rambunctious Rogers Centre crowd of 44,668.

"I just tried to throw a hard pitch to hit," Osuna said via a translator. "My fastball just stayed down the middle and he took advantage of it."

Baltimore closer Zach Britton worked a 1-2-3 ninth for his 47th save in 47 opportunities. The Blue Jays wasted a solid outing from Toronto starter Francisco Liriano, who struck out 10 batters over 6 1/3 innings.

Toronto scored on sacrifice flies in each of the first two innings and had chances to tack on to its lead during the game. However, Jose Bautista was doubled off after a baserunning gaffe in the sixth inning and Melvin Upton Jr., struck out with the bases loaded to end the eighth.

After the rubber game of the three-game set on Thursday, the Blue Jays will close out the regular season with a three-game weekend series in Boston. The Red Sox clinched the East Division title on Wednesday with the Toronto loss.

"I think we're going to be fine," Osuna said. "We're playing the best teams in the major leagues and in our division. Stuff like today, it's supposed to happen sometimes. But I'm not worried at all (about the bullpen) and I think we're going to be in good position for the next four games."

Baltimore starter Chris Tillman allowed one earned run and six hits over 5 2/3 innings. Brian Duensing (1-0) got the last out of the eighth for the win.

Baltimore outhit Toronto 11-6 and the game took three hours four minutes to play.

Notes: It was the first time in over five years that Toronto starters have recorded back-to-back games of 10 strikeouts or more. Aaron Sanchez fanned 10 in a 5-1 victory on Tuesday night. Brandon Morrow and Ricky Romero last achieved the feat on April 23-24, 2011. ... Toronto's Marcus Stroman (9-9, 4.34 ERA) is scheduled to start on Thursday against fellow right-hander Ubaldo Jimenez (7-12, 5.71). ... The Orioles will close out the season with three games in New York.