One well-timed swing by Carlos Beltran produced all the runs the Yankees needed to squeeze past White Sox ace Chris Sale in a 3-2 victory Thursday night at Yankee Stadium.

Yankees starter Michael Pineda (12-8) gave up eight hits in six innings but allowed only one run after pitching his way out of a couple of tough spots.

Pineda's performance marked the 10th time in the past 11 games that a Yankees starter allowed two or fewer earned runs. Andrew Miller allowed one hit but struck out two in earning his 35th save.

The Yankees trail Toronto by three games with 10 left to play for each team. Their magic number to clinch a wild-card berth is five.

"Pineda threw a lot of strikes," Joe Girardi said. "The best thing he did was pitch out of jams in the third and fifth."

Although Pineda had thrown only 89 pitches, including 70 for strikes, Girardi lifted him after he gave up a leadoff home run to Trayce Thompson in the sixth that cut the Yankees' lead to 3-1. "He had just given up a home run, and I wanted [reliever Justin] Wilson to get a fresh inning," Girardi said.

advertisement | advertise on newsday

It was a second straight strong performance for Pineda, who was coming off a win over the Mets, but the early exit left a sour taste. "I feel pretty strong," he said. "I wanted to pitch into the seventh. The slider and changeup were working good. I always want to stay in the game."

Pineda got in a spot of trouble in the third inning when he allowed the White Sox to load the bases on three singles spaced around two outs. But he struck out cleanup hitter Thompson on a 95-mph fastball.

Sale (12-11) began the bottom of the third by hitting Jacoby Ellsbury, who promptly stole second base. But Ellsbury took himself out of scoring position when he was called out for interfering with Chicago shortstop Alexei Ramirez's attempt to field a weak pop-up by Chase Headley.

Sale then walked Alex Rodriguez before cleanup hitter Beltran sent a 98-mph fastball on a line into the leftfield seats for his 18th home run and a 3-0 Yankees lead.

Rodriguez scored the 2,000th run of his career, putting him in rare company with Hank Aaron as the only players in history with 3,000 hits, 2,000 RBIs and 2,000 runs scored.

Yankees videos

"The pitchers made it stand up," Girardi said of Beltran's blast.

Pineda avoided another scare in the fifth. With runners on first and second and one out, third baseman Headley robbed Jose Abreu of an extra-base hit, backhanding his hot shot down the line and throwing him out at first before Melky Cabrera grounded out weakly. But the White Sox finally dented Pineda for a run in the sixth on Thompson's homer.

"I tried to throw a fastball inside, and he got it," Pineda said. "But I'm very happy for winning the game. The team is fighting to win the division."

Wilson got the first two outs in the seventh but walked Adam Eaton and gave up a bloop single to Abreu, prompting Girardi to bring in Dellin Betances. He issued two straight walks to force in a run before striking out Adam LaRoche to end the inning.

"I feel like my timing is off," Betances said. "I'm limiting the damage, but I can't keep doing it. I have to figure it out going to the playoffs."