NEW YORK — Steven Wright had the secret to success against that torrid Yankees lineup.

Throw it soft and slow.

Wright handcuffed New York hitters with his steady supply of floating knuckleballs, and David Ortiz launched a colossal home run for the Boston Red Sox in their 2-1 victory on Wednesday night.

“Given this lineup in this ballpark,” Red Sox Manager John Farrell said, “he was outstanding from start to finish.”

A costly throwing error by third baseman Chase Headley helped spoil the debut of prized Yankees pitching prospect Luis Severino, who yielded only two hits over five impressive innings. He struck out seven and walked none.

Koji Uehara retired pinch-hitter Brian McCann with two on in the ninth inning for his 24th save in 26 attempts.

Alejandro De Aza hit an RBI double with two outs in the second – immediately following Headley’s 18th error. In the fourth, Ortiz connected on a 96 mph 2-0 fastball leading off the fourth, a drive that landed more than halfway up the elevated concrete bleachers in right field.

“We don’t leave New York without David probably going deep one time. He just put a beautiful swing on the pitch,” Farrell said. “But there’s no question we’ll see Severino a lot in years to come, and that’s a good-looking young pitcher.”

The last-place Red Sox snapped an eight-game road losing streak behind Wright (5-4). He struck out nine in eight innings, setting career highs in both categories for the second consecutive start.

Tossing his 74-75 mph knuckler to both sides of the plate, the 30-year-old righty allowed just four hits – including Carlos Beltran’s leadoff homer in the seventh.

“Today it just was moving a little bit more than it has in the past,” Wright said.

Uehara worked around a single and a walk in the ninth. McCann, who flied out to center, did not start because of a stiff left knee.

“That’s about as good as you can throw a knuckleball,” Yankees slugger Mark Teixeira said.

Severino (0-1) threw 94 pitches, flashing a 97 mph fastball and sharp slider. The 21-year-old righty began the season in Double-A, then went 7-0 with a 1.91 ERA in 11 starts at Triple-A – where he did not give up a homer in 611/3 innings.

The Yankees said Severino became the first pitcher in American League history to give up no more than two hits with seven strikeouts and no walks in his major league debut.

“He’s got poise. I told you I didn’t think his surroundings would affect him a whole lot. We saw that in spring training,” Manager Joe Girardi said.

NOTES: Farrell said he had no update on pitching prospect Brian Johnson, who went on the minor league disabled list Monday with a sore left elbow. Johnson has made one major league start, taking the loss July 21 at Houston. … There is no target date for the return of OF Mookie Betts (concussion),” Farrell said. … RHP Rick Porcello (right triceps) is on the disabled list, retroactive to July 30. “Shouldn’t be a long absence,” Farrell said.