NEW YORK — The talk about whether the New York Yankees should buy or sell at the non-waiver trade deadline still exists. Scouts are flocking to Yankee Stadium to see any players who may be traded, and rumors are flying.

With another day knocked off the calendar until the Aug. 1 deadline, there is a new topic surrounding the Yankees — making a run at first place in the American League East.

It could be realistic if the Yankees see things unfold as they did Wednesday.

Michael Pineda pitched six effective innings, and Mark Teixeira and Carlos Beltran homered in New York’s fourth consecutive victory, a 5-0 decision over the Baltimore Orioles.

The Yankees (48-46) matched a season high by going two games over .500.

“We’ve always felt that way,” Teixeira said regarding his team being a contender. “It’s a long season. I’m not sure exactly how many games are left, but there’s a lot of games left, and we never got too low when we were struggling early on in the season and we’re not going to celebrate because we won four in a row because we got to go win tomorrow.”

The Yankees moved two games over .500 for the first time since being 4-2 on April 12. After starting their 10-game homestand with two losses to the Boston Red Sox, they faced the possibility of a double-digit deficit in the division had the Baltimore Orioles won and the Yankees lost Sunday.

Instead, the Orioles haven’t won since Saturday and the Yankees haven’t lost since then, cutting a 9 1/2-game deficit to six while also knocking Baltimore out of first place. Boston is a half-game in front the Orioles.

“The mentality is to (be) two, three games over (.500) doesn’t mean anything unless you’re able to beat the teams in your division,” Beltran said.

Manager Joe Girardi added, “It’s playoff baseball for us, and we have to play extremely well. I think they’re responding especially after we lost two to start out this homestand. They responded well, and we need them to keep doing that.”

Pineda (4-9) set the tone with his best outing of the season, allowing five hits and two walks while holding the Orioles to one hit in nine at-bats with runners in scoring position. The inconsistent right-hander survived jams in the fourth and sixth, when he got five of his eight strikeouts.

“We made him work,” Baltimore center fielder Adam Jones said of Pineda, who threw 113 pitches. “We were unable to get anything across on him, but we made him work.”

In the fourth, the Yankees held a 1-0 lead (thanks to Beltran’s first-inning sacrifice fly) when Pineda loaded the bases on two singles and a walk. He escaped trouble by using his slider for strikeouts of Nolan Reimold and Ryan Flaherty.

After Pineda escaped his first jam, Teixeira made it 2-0 with his eighth home run.

Pineda then escaped again in the sixth when he stranded Mark Trumbo at third. Trumbo opened the inning by doubling and taking third on a flyout by Pedro Alvarez, but Pineda kept him there by using his fastball to fan J.J. Hardy on a check swing and his slider to retire Reimold.

“It could have been a different story, but right now we’re not getting that,” said Baltimore acting manager John Russell, who filled in for Buck Showalter (stomach virus). “We got to find a way to make that happen a little bit more. If we push maybe one, two runs across right there, I think it’s a different ballgame.”

After Pineda exited following his first scoreless outing since Sept. 19, 2015, the Yankees tacked on three more runs. Teixeira drew a bases-loaded walk in the sixth, Brett Gardner lifted a sacrifice fly in the seventh, and Beltran reached the 20-homer level for the 12th time in his career in the eighth.

“Mike was great tonight,” Teixeira said. “He’s got number one (pitcher) stuff. He throws 96 (mph) with a great slider. When he puts it together, he can have nights like he did tonight.”

Dellin Betances, Nick Goody and Chasen Shreve each threw a perfect inning to complete New York’s fifth shutout.

The Orioles (53-40) played without Chris Davis and Manny Machado, who sat with stomach viruses. Jones also exited the game with back spasms but said he expects to play Thursday.

Baltimore, which has scored twice in 27 innings in New York, was blanked for the first time since May 17 and the fifth time overall this year. The Orioles also fell out of first place for the first time since June 4.

Orioles starter Yovani Gallardo (3-2) allowed four runs and five hits in seven innings.

Comments