NEW YORK — Gary Sanchez did his part, again. A double, a single and a taped appearance on the center-field videoboard in a trivia quiz.

Showing up on the scoreboard was a lot harder for the New York Yankees.

Coming off a pair of blowout victories, the Yankees were blanked at home for the first time in more than a year Sunday, 5-0 by Kevin Gausman and the Baltimore Orioles.

“If someone says you’re going to win a series against Baltimore, I think you’re going to be pretty positive,” New York manager Joe Girardi said. “But when you win the first two, sometimes guys can get down a little bit.”

The Orioles got battered in the first two games of the series, outscored 27-9. Baltimore bounced back in the matchup between AL East playoff contenders, halting its three-game skid and ending the Yankees’ win string at four.

Sanchez had homered in three straight games. The rookie sensation is hitting .405 in 22 games this year.

“Like I said before, I’m not changing anything,” he said through a translator.

Gausman tamed the torrid Yankees hitters, Mark Trumbo lined his major league-leading 40th home run and Steve Pearce also connected as Baltimore averted a bruising sweep.

Gausman (6-10) threw seven innings, and newly signed Tommy Hunter and closer Zach Britton finished up.

CC Sabathia (8-11) shut out the Orioles on two singles until Pearce led off the sixth with his 12th home run.

“I mean, it’s baseball. You know, just trying to keep us in the game, and their guy was pitching good, so I was just trying to get us back in the dugout,” Sabathia said.

Earlier in the game, Pearce had been having fun with the fans in right field, tossing them balls after warmups between innings — he provided another souvenir with his drive to deep left.

Pearce greeted reliever Adam Warren with a two-out, bases-loaded single in the seventh for a 3-0 lead.

Trumbo connected in the eighth for a two-run shot off Ben Heller. The slugger reached 40 home runs for the first time in his career and boosted Baltimore’s homer total to 204, most in the majors.

SANCHEZ STATS

Sanchez has reached safely at least twice in six straight games, the team’s best streak this season. … Sanchez is 13 for 22 (.591) with five homers, 10 RBIs and four walks in his last six home games. … With 11 home runs and eight doubles, Sanchez has tied Joe DiMaggio for the most extra-base hits in the first 24 games for a Yankees player.

TRAINER’S ROOM

Orioles: CF Adam Jones (hamstring) hasn’t played since an early exit Friday night. “We’ll see what tomorrow brings. He’s getting there. He’s getting there,” manager Buck Showalter said. … RHP Chris Tillman (right shoulder bursitis) is progressing well and his throwing session was moved up a day to Monday. He can come off the disabled list Sept. 5, but Showalter said it would likely be a few days after that.

Yankees: 3B Chase Headley didn’t start for the second straight day. He’s feeling fine, Girardi said, but Ronald Torreyes is playing well and getting extra time. Torreyes doubled and singled.

UP NEXT

Orioles: In a matchup of AL East contenders, the O’s open a three-game series at home vs. Toronto on Monday night. LHP Wade Miley (8-10, 5.51 ERA) is 1-2 with an 8.18 ERA in five starts since Baltimore got him from Seattle at the trade deadline. RHP Marco Estrada (7-6, 3.47) pitches for the Blue Jays.

Yankees: RHP Michael Pineda (6-10, 5.02) starts the opener of a three-game series at Kansas City on six days’ rest. RHP Dillon Gee (5-7, 4.55) pitches for the Royals.