NEW YORK — Alex Rodriguez moved past Hall of Famer Willie Mays into sole possession of fourth place on baseball’s career home run list with 661st and the New York Yankees held off the Baltimore Orioles 4-3 in the opener of a four-game series on Thursday night.

Rodriguez passed Mays with a solo home run in the third inning. He tied Mays with his first career pinch-homer against Boston reliever Junichi Tazawa on Friday in Fenway Park.

After Rodriguez rounded the bases, the scoreboard made a brief acknowledgment of the home run and he was given a short curtain call.

First baseman Mark Teixeira drove in the other two runs with a single and a double for the Yankees, who won for the 12th time in 16 games.

Designated hitter Jimmy Paredes and catcher Caleb Joseph hit solo home runs for Baltimore. Joseph also had an RBI double, but first baseman Chris Davis struck out four times and shortstop J.J. Hardy went 0-for-4 in his season debut.

Both starting pitchers lasted into the sixth inning but constantly had runners on base.

New York’s Nathan Eovaldi (3-0) remained unbeaten despite allowing three runs and six hits in 5 2/3 innings. Baltimore right-hander Chris Tillman (2-4) also went 5 2/3 innings and allowed four runs and 10 hits, one shy of his career high.

Yankees left-hander Justin Wilson got four outs, Dellin Betances pitched a hitless eighth and Andrew Miller struck out two in the ninth for his 12th save.

The Orioles took a 1-0 lead with one out in the first inning when Paredes hit his fourth home run of the season.

The Yankees scored twice in the bottom of the first, though they almost took a 3-1 lead.

After consecutive singles by center fielder Jacoby Ellsbury and left fielder Brett Gardner, Rodriguez was robbed of a homer when right fielder Delmon Young made a leaping catch just in front of the right field wall.

After Rodriguez’s sacrifice fly, the Yankees took a 2-1 lead on a single by Teixeira, who was thrown out by Young trying to take second.

The Orioles tied it with one out in the second when Joseph drove a 2-0 fastball just over the left field fence.

The Yankees regained a one-run lead with two outs in the third when Rodriguez drove a 1-1 pitch from Tillman over the center field wall.

Baltimore forged a 3-3 tie on Joseph’s double. After Paredes was picked off for the second out, Eovaldi escaped by retiring center fielder Adam Jones on a groundout.

New York took a 4-3 lead when Gardner doubled and scored on a two-base hit by Teixeira.