Starlin Castro and Enrique Wilson do not have much in common beyond a home country, a position and a pinstriped jersey.

But there’s also this: The Dominican Republic natives each have dominated an elite pitcher.

For Wilson, it was Pedro Martinez. For Castro, it is Madison Bumgarner.

Wilson — who wore No. 14 for the Yankees before Castro — was primarily a backup who could fill in as needed at second base, shortstop and third. But when Martinez was on the hill for the Red Sox, Wilson essentially became a starter.

Wilson hit .364 in 33 at-bats against the Hall of Famer and three-time Cy Young award winner, compared to .244 for his career. Only seven of the 78 players with 30 or more at-bats against Martinez had a better average.

For fairness’ sake in this comparison, Castro has started 92 of 94 games and hit .265 in his first year with the Yankees. He is an integral cog in the team’s lineup.

But batting second in the order has been a rarity (15 starts), and that’s where Joe Girardi slotted Castro for Friday night’s game against the Giants’ Bumgarner, the four-time All-Star and big-game pitcher who has allowed one run in 36 World Series innings.

advertisement | advertise on newsday

The logic? With lefties batting .172 against him this season, Girardi chose to rest Jacoby Ellsbury, the regular No. 2 hitter. And Castro was 11-for-26 against Bumgarner coming in.

Castro did not regress towards his career average of .279. Instead, he went 3-for-4 against Bumgarner to raise his average to .467 against him.

In the first inning, Castro turned on Bumgarner’s 89.7 mph fastball and forced leftfielder Angel Pagan to chase the shot to the wall. The ball left his bat at 110 mph and went for an RBI double that gave the Yankees a 1-0 lead.

He singled to left in the second inning and hit a looping single to shallow center leading off the fifth.

Bumgarner induced an easy fly ball to right to finally retire Castro in the seventh.