NEW YORK -- The Yankees are finally hitting and pitching well at the same time, and that may keep these batters and hurlers together in New York for at least a little while longer.
Michael Pineda didn't allow a run for the first time this season, Mark Teixeira homered in his return from his latest injury, and the Yankees moved two games above .500 for the first time since April with a 5-0 victory over the Baltimore Orioles on Wednesday night.
Pineda (4-9) had six strikeouts with runners in scoring position, repeatedly wriggling out of jams to get through six innings and protect the bullpen.
New York, which has won the first three of the four-game series, last was two games over .500 on April 12 at 4-2. The Yankees are six games out of first in the AL East and five out of the wild-card spot as management tries to determine whether to unload veterans at the trade deadline.
"You know with the situation looming that it's really important as we move forward -- in a sense, it's playoff baseball for us," manager Joe Girardi said.
Baltimore lost its fourth straight to fall a half-game behind Boston in the division. Left shorthanded by illness and injury, the Orioles have struggled at the plate, especially with runners in scoring position: They went 1 for 9 Wednesday and are 3 for 33 since the All-Star break.
A stomach bug has been ravaging Baltimore's clubhouse and claimed two more victims Wednesday: third baseman Manny Machado and manager Buck Showalter. First baseman Chris Davis missed his third straight game.
Catcher Matt Wieters was also out with a foot injury. Bench coach John Russell filled in for Showalter.
The bottom third of Baltimore's lineup, all backups forced into action, went a combined 0 for 9.
"We are going to have to find different ways to manufacture a little bit," Russell said.
Yovani Gallardo (3-2) couldn't keep it close, though he didn't get much help from his defense. He allowed four runs and five hits with five strikeouts and four walks in seven innings.
Leading off the bottom of the first, Brett Gardner ripped a line drive to the warning track that right fielder Joey Rickard tracked down, but the ball bounced off the inside of his glove. Center fielder Adam Jones then bobbled it, and Gardner motored into third for what was ruled a triple. Carlos Beltran drove him in with a one-out sacrifice fly.
The Yankees had not scored a first-inning run in their previous 23 games.
Trailing 1-0, the Orioles had the bases loaded with one out in the fourth but Pineda struck out Nolan Reimold and Ryan Flaherty. Pineda allowed five hits and two walks, striking out eight, to post his first win since June 7.
He threw 11 pitches to the game's first hitter, Rickard, and was constantly pushing up against a high pitch count -- he finished with 113, one shy of his season high. Dellin Betances, Nick Goody and Chasen Shreve completed the shutout to extend the bullpen's scoreless streak to 28 2/3 innings dating to July 9.
Yankees pitchers have allowed one run or fewer in four straight games for the first time since 2003.
Before the game, Teixeira had described this season as "brutal" and "terrible." He was batting .186 and had missed three games because of a sore left foot.
Then the veteran first baseman lined a solo homer to right in the fourth for a 2-0 lead. He also walked twice, including on four pitches in the sixth with the bases loaded to force in a run and make it 3-0.
"In order for us to make a run we have to be consistent," Beltran said. "We've been pretty consistent this series."
Yankees LHP CC Sabathia (5-7) starts on his 36th birthday Thursday to close out the four-game series. He has a 7.48 ERA in four career starts on his birthday; he also has a 7.94 ERA since June 22.
Ted Williams homers in final at-bat
On Sept. 28, 1960, Ted Williams goes deep for the last time in his final at-bat.
Los Angeles Angels' Shohei Ohtani wants to remain 2-way player in 2021
Shohei Ohtani, who batted .190 during the 60-game season and suffered a forearm strain that limited him to parts of three innings over two games on the mound, says he wants to remain a two-way player for the Angels.
Yankees' DJ LeMahieu wins AL batting title; Luke Voit finishes with majors-leading 22 home runs
The Yankees may be limping into the wild-card round, but there was a bright spot in Sunday's regular-season finale as DJ LeMahieu captured the AL batting crown with a major-league-leading .364 average, and Luke Voit (22) earned the home run title.
Miami Marlins' Starling Marte, Jose Urena hurt against New York Yankees
Miami outfielder Starling Marte and right-hander Jose Urena left Sundays' regular-season finale against the New York Yankees after getting hurt in the early innings.
Odor homers twice to power Rangers' win
Rougned Odor hits two home runs in a four-RBI outing as Texas defeats Houston.
Altuve absolutely clobbers HR
Jose Altuve hits a solo dinger off the second deck in the first inning.