Boston Red Sox designated hitter J.D. Martinez hits a single to drive in two runs against the Los Angeles Dodgers during the fifth inning in Game 2 of the World Series on Wednesday, Oct. 24, 2018, in Boston. (AP Photo/Elise Amendola)

BOSTON — J.D. Martinez and the Boston Red Sox made magic with two outs during the American League playoffs.

With a World Series title on the line, seems they have plenty left.

Martinez delivered a two-out, tiebreaking single , and Boston got all its runs with two down while beating the Los Angeles Dodgers 4-2 on Wednesday night for a 2-0 Series lead.

Boston has done most of its scoring with two in the books: nine of its 12 runs through two World Series games have come that way, and 36 of 68 for the postseason.

Martinez has been the electrifying force for much of that two-out October lightning. He entered Wednesday batting .667 with a 1.515 OPS with two outs in the postseason.

Despite playing on the sore right ankle he rolled in Game 1, Boston’s free-agent pickup went the other way for a two-run single in the fifth, a two-out knock that snapped a 2-all tie.

Martinez has 13 RBIs through 11 postseason games, and seven of those have come with two outs.

“We just have guys that really do a really good job of grinding at-bats out and turning the lineup over,” Martinez said. “I think everybody takes pride in that.”

How have they done that, exactly?

“It’s about finding a way to spoil a good pitcher’s pitches,” he said.

The numbers show just how masterful Boston has been at it.

The Red Sox entered Wednesday batting .405 with a 1.335 OPS with two outs and runners in scoring position in the postseason, getting 29 runs out of those situations. Then they went 2 for 4 in those situations Wednesday.

Nothing new for Boston. The 108-win Red Sox led the majors with 329 two-out runs during the regular season.

“We just play 27 outs,” Mookie Betts said. “It’s just one of those things where you can’t give them away. Fortunately, we don’t give them away.”

Rookie manager Alex Cora said he thinks their success comes from keeping an aggressive mindset at the plate, regardless of the situation.

“In the playoffs, we talked about it before we started: Get the leadoff guy out, don’t give up two-out hits or runners. And we’ve been doing that to the opposition,” he said.

That relentless offense has chased some of baseball’s best pitchers thanks to having threats 1 through 9 in the batting order.

In Game 1, Andrew Benintendi had four hits — three off Clayton Kershaw. Eduardo Nunez then provided a pinch-hit, three-run homer late to help seal it. Of course, Nunez did it with two outs.

Ian Kinsler started Wednesday’s two-out trouble, driving a single down the third-base line to score Xander Bogaerts from second on a two-out pitch from starter Hyun-Jin Ryu in the second.

Ryu nursed a 2-1 lead into the fifth and got two quick outs. Then he gave up consecutive singles to Christian Vazquez and Betts before walking Benintendi.

Ryan Madson relieved with the bases loaded. For the second night in a row, he began his outing by walking Steve Pearce, this time to bring in the tying run.

Martinez then poked a fastball into shallow right, bringing Betts and Benintendi around to score.

And just like that, the World Series was two down, two to go for the Red Sox.