Arizona Diamondbacks second baseman Jean Segura, right, leaps after forcing out Los Angeles Dodgers’ Enrique Hernandez (14), to make the relay to first, but not in time to get Yasiel Puig during the first inning of a baseball game in Los Angeles, Tuesday, April 12, 2016. (AP Photo/Alex Gallardo)
Arizona Diamondbacks second baseman Jean Segura, right, leaps after forcing out Los Angeles Dodgers’ Enrique Hernandez (14), to make the relay to first, but not in time to get Yasiel Puig during the first inning of a baseball game in Los Angeles, Tuesday, April 12, 2016. (AP Photo/Alex Gallardo) Credit: ap — Alex Gallardo

Los Angeles — Paul Goldschmidt hit a go-ahead homer in the eighth inning and drove in another run, and the Arizona Diamondbacks beat Los Angeles 4-2 to spoil the Dodgers’ home opener Tuesday in Vin Scully’s final season.

Goldschmidt gave the D-backs a 2-1 lead with his second homer of the season off Chris Hatcher (1-1), who then gave up a two-out double to Welington Castillo before issuing consecutive walks to Jake Lamb (intentional) and Yasmany Tomas that loaded the bases. Hatcher departed to boos.

Arizona added two more runs in the ninth on Socrates Brito’s triple and Goldschmidt’s groundout to shortstop.

Kenta Maeda allowed five hits over six scoreless innings, struck out four and walked one in becoming the second Japanese pitcher to start a Dodgers home opener since Hideo Nomo in 1996 and 2004.

Tigers 8, Pirates 2

Detroit— Justin Upton had four hits, including a first-inning home run off a camera well above center field, and Detroit beat Pittsburgh.

Upton entered batting .227 with 10 strikeouts in 22 at-bats, then raised his average to .333 with the 11th game of four hits or more in his big league career. According to MLB’s Statcast system, the home run would have gone 451 feet had it landed unimpeded.

J.D. Martinez had his second career four-hit game, and Ian Kinsler homered.

Yankees 3, Blue Jays 2

Toronto— Jacoby Ellsbury singled home the tiebreaking run in the seventh inning, Brian McCann hit a solo home run and New York beat Toronto.

Johnny Barbato (1-0) pitched a scoreless inning for his first major league win in the first game between these AL East rivals this season. The Yankees lost 13 of 19 meetings with Toronto last year.

McCann finished 2 for 3 with a walk and scored twice. Andrew Miller got his second save.

Rays 5, Indians 1

St. Petersburg, Fla.— Logan Forsythe and Evan Longoria both hit two-run home runs in the eighth inning, and Tampa Bay beat Cleveland.

Forsythe ended Cory Kluber’s night with his shot that made it 3-1 on a full-count, two-out pitch. Longoria added his drive off Cody Allen.

Matt Moore gave up one run, five hits, one walk and had five strikeouts in seven innings for the Rays. Xavier Cedeno (1-0) pitched a perfect eighth.

Phillies 3, Padres 0

Philadelphia — Charlie Morton pitched sharply into the seventh, Odubel Herrera hit an RBI triple in the sixth and the Philadelphia beat San Diego.

Morton (1-1) allowed three hits, walked four and struck out seven in 6 innings for his first win with the Phillies.

Padres left-hander Robbie Erlin (1-1) retired the first 10 batters and didn’t allow a hit until Freddy Galvis got a hard single to center with two outs in the fifth. He allowed one run, three hits and fanned seven in six innings.

Nationals 2, Braves 1

Washington — Bryce Harper sliced a two-run double to left with two outs in the eighth inning, lifting Washington past Atlanta for the Nationals’ 12th consecutive home victory against the Braves.

Harper, the reigning NL MVP, broke a scoreless tie by connecting with the first pitch delivered by left-handed reliever Eric O’Flaherty after righty Jim Johnson (0-2) put two runners on. The hit hooked toward the line and away from left fielder Jeff Francoeur, who dove in a bid to make a catch but had the ball go off his glove.

Marlins 2, Mets 1

New York — Dee Gordon sparked the decisive rally with a single on the 16th pitch of his gritty at-bat and Miami edged New York to win a much-anticipated pitching matchup that mostly lived up to its billing.

Noah Syndergaard struck out 12 for the slumping Mets and left with the score tied at 1 after seven innings. Miami ace Jose Fernandez recovered from a shaky start and went five innings.

Derek Dietrich had an RBI single in his first start of the season for the Marlins, and pinch-hitter Martin Prado delivered a go-ahead sacrifice fly in the eighth against Jerry Blevins. Gordon stole second base and scored the tiebreaking run after leading off with a single on the 16th pitch from Jim Henderson (0-1).