DETROIT (AP) -- Dixon Machado came to the plate with only one big league homer to his name, but the way this game was going, anything seemed possible.
"Walking to the plate I was thinking, `What if I hit a homer right here?"' the Detroit infielder said. "He threw me a fastball away but when he came in with a pitch I was ready for it and I just hit it hard."
Machado led off the bottom of the ninth with a home run , capping a wild final two innings and lifting the Tigers over the Baltimore Orioles 6-5 on Wednesday. Detroit led 2-1 before each team scored three runs in the eighth and one in the ninth.
Baltimore's Luis Sardinas tied it with a solo shot off Shane Greene (1-0) in the top of the ninth, but then the 26-year-old Machado hit a line drive off Pedro Araujo (1-2) that cleared the fence in left field. It was his second homer in 299 big league at-bats.
The game was moved from 6:40 p.m. to 1:10 p.m. in anticipation of bad weather. Although it was a sparse crowd, to say the least , the sun did come out, and those fans in attendance were treated to quite a few homers.
Miguel Cabrera went deep on his 35th birthday, and Jeimer Candelario and John Hicks also homered for Detroit. Hicks hit a three-run shot in the eighth that put the Tigers up 5-4.
Danny Valencia hit a solo homer for the Orioles, who have lost five straight.
Detroit's Matthew Boyd allowed a run, two hits and three walks in 6 1/3 innings, striking out six. Baltimore's Kevin Gausman allowed two runs and nine hits in six-plus innings.
Cabrera's solo homer put the Tigers up 2-1 in the sixth, but Manny Machado and Chris Davis hit RBI singles as part of a three-run rally by Baltimore in the eighth. The drive by Davis was nearly a home run, but it hit the wall and stayed in play.
"There were obviously a couple bad breaks -- our ball hits the top of the fence and comes back and their ball goes over -- but there were four or five breaks we got during the game on bounces or pitch calls," Orioles manager Buck Showalter said. "If you lose focus and start feeling sorry for yourselves, every team you play is going to take advantage and step on your throat."
Boyd and Gausman were both impressive, albeit forgotten a bit after all the scoring in the late innings. Boyd became the first Tigers left-hander since at least 1908 to pitch six or more innings while allowing one or fewer runs in each of his first three starts of a season. He's still without a win in 2018, however.
Gausman finished with a quality start. The Orioles have had eight of those this year, but they're just 3-5 in those games.
Gausman said he started messing around with a new windup recently, and pitching coach Roger McDowell was working with him.
"He told me that I wouldn't dare use it today," Gausman said. "When you tell me I won't do something, I want to do it."
Cabrera went 2 for 4 and is 21 for 54 on his birthday -- a .389 average. He also has homered three times on April 18.
He was happy to have such an exciting win on his birthday.
"Beautiful. Very cool," he said. "Now I can go home and watch TV with my family and get ready for tomorrow."
Tigers: Cabrera had left Tuesday night's game with back tightness.
Detroit RHP Jordan Zimmermann (0-0) is to take the mound against RHP Alex Cobb (0-1) in the series finale Thursday.