TORONTO -- Some of Toronto's quietest hitters came through at the right time Thursday night as the Blue Jays came back for a 5-4 victory over the Baltimore Orioles.

Randal Grichuk delivered a two-run double in Toronto's three-run ninth inning and Aledmys Diaz drove in Teoscar Hernandez with the winning run in the 10th to give the Blue Jays a walkoff win.

It was Toronto's second victory in nine games.

"Obviously we desperately needed that, if you want to know the truth," said Blue Jays manager John Gibbons. "Maybe that'll get us on a roll a little bit, we'll see."

Grichuk entered the game with a dismal .115 average while Diaz came in with a .208 mark. Both had multi-hit games as Toronto earned its second home win in its last 12 tries at Rogers Centre.

"A big comeback win late does a lot to the team," Grichuk said. "It feels great. You all hear it in this clubhouse. The guys are going crazy.

"That's the type of stuff that carries over and you can create a winning streak from that."

Baltimore reliever Brad Brach blew the save opportunity as Grichuk cashed in Luke Maile and Diaz before scoring on a Kevin Pillar single.

"Brad's been throwing real well," said Orioles manager Buck Showalter. "Tonight wasn't one of those nights."

Reliever Miguel Castro came on and got Yangervis Solarte to hit into a double play to force extra innings. In the 10th, Hernandez hit a flare into shallow left-centre field and stretched it into a double.

"That's one of those ones where it's like oh-oh, don't, don't, don't, don't, and then he's safe and it's like, 'Great play,"' Gibbons said with a smile.

After an intentional walk and two strikeouts, Diaz lashed a single off Castro (1-2) into left field to bring Hernandez home.

"It just shows that we haven't put our heads down," Diaz said via a translator. "It's a long season and we know we have to grind. So it feels great to have a win like that and hopefully it's just going to keep going."

Danny Barnes (2-1) worked an inning of scoreless relief for the win. Baltimore fell to 19-42 on the season while the Blue Jays improved to 27-35.

Each team scored a run in the opening frame. Manny Machado's sacrifice fly brought home Trey Mancini but leadoff hitter Curtis Granderson answered in the bottom half with his fifth homer of the year.

Toronto's Jaime Garcia, coming off a season-worst five-out outing in his last start, was efficient over the next four innings before running into trouble in the sixth.

The Orioles loaded the bases but Garcia struck out Chris Davis to end the threat. Garcia allowed one earned run, four hits and three walks over six innings while striking out six.

Baltimore starter David Hess held the Blue Jays to five hits, one earned run and two walks over six innings plus a batter. He had four strikeouts.

Austin Wynns gave Baltimore a 2-1 lead in the seventh inning when he went deep off Tyler Clippard for his first career homer. Danny Valencia and Mark Trumbo added solo homers in the eighth off John Axford.

Valencia's sixth homer of the year landed in the second-level standing-room section above the wall in centre field.

Trumbo hit a liner with an exit velocity estimated at an impressive 109 miles per hour for his third homer of the season.

Announced attendance was 24,494 and the game took three hours 13 minutes to play.

Notes: Blue Jays blue-chip prospect Vladimir Guerrero Jr. was placed on the seven-day disabled list Thursday by the double-A New Hampshire Fisher Cats. He left a game Wednesday with an apparent leg injury. The team has not revealed specifics but the injury is not believed to be serious. ... Toronto right-hander Marcus Stroman, currently on the DL with a shoulder injury, is scheduled to throw a three-inning simulated game Friday in Dunedin. ... Blue Jays third baseman Josh Donaldson took ground balls at third base before batting practice. He's eligible for activation from the DL (calf) on Friday. ... Blue Jays left-hander J.A. Happ (7-3, 4.08 ERA) is scheduled to start Friday night against right-hander Andrew Cashner (2-7, 5.02).