SEATTLE — The opportunity to take his shiny new bullpen out for a spin presented itself to Joe Girardi in the sixth inning Thursday night.

Brett Gardner snapped a scoreless tie with a one-out solo home run in the top of the sixth off Felix Hernandez and Girardi had the embarrassment of riches now comprising the Yankees’ pen at his disposal.

But there was the matter of Luis Severino.

The 23-year-old had a shutout going and was only getting stronger as the night wore on.

So while Dellin Betances pitched a shaky but scoreless eighth and, after Robinson Cano gifted the Yankees two runs with a throwing error in the ninth that made Aroldis Chapman’s shaky appearance a non-save situation, the Yankees’ 4-1 victory over the Mariners at Safeco Field was all about Severino.

The righthander, with as good a changeup as he’s had all season, threw seven shutout innings. Severino, who picked up his first victory since June 10 against the Orioles in improving to 6-4 with a 3.21 ERA, allowed eight hits, struck out six and walked one.

“I liked the way he was throwing the ball,” Girardi said. “I just said, ‘You know what, it’s his game, he’s pitching extremely well, I’m going to let him have it.’ ”

advertisement | advertise on newsday

Severino was 0-2 with a 4.70 ERA in his previous six starts. But he was coming off an outing Saturday in Boston when he allowed one run and four hits over seven innings, going toe-to-toe with Red Sox ace Chris Sale.

Thursday night it was Hernandez, who allowed one run and three hits over seven innings in one of his best outings of the season. Hernandez (5-4, 3.88) struck out a season-best nine and walked two.

“I enjoy it,” Severino said of the challenge of facing another team’s ace. “I know it’s going to be tough every time I face a guy like Felix. I just try to bring my ‘A’ stuff.”

The win allowed the Yankees (49-45) to stay a few steps ahead of the Mariners (48-49), one of a handful of AL teams in the wild-card hunt.

Gardner’s homer was, to that point, just the second hit of the night for the Yankees, who finished with seven.

Yankees videos

“He threw me a fastball,” Gardner said of the 2-and-1 pitch he hit for his 16th homer, which improved him to 13-for-36 in his career against Hernandez. “He kind of left it middle and I took a good swing on it. Important for me not to miss pitches like that.”

Severino got more dominant in the latter innings.

He limited the Mariners to 1-for-8 with runners in scoring position, stranding nine. Seven of those were stranded over the first four innings.

“To me that’s growth,” Girardi said of Severino’s ability to get out of those kind of jams. “And I think he used all his pitches tonight. It’s just him maturing.”

Severino, still throwing 100 mph in his final inning, allowed just two base runners over his last three innings.

advertisement | advertise on newsday

“When he’s on the mound, it doesn’t really matter who’s on the mound on the other side, we feel confident in the job that he’s going to do,” Gardner said of Severino. “Every time Sevy pitches, we feel good about our chances.”

Aaron Judge’s RBI single in the eighth made it 2-0. Betances then put two on in the bottom half. But with runners at the corners and two outs, Betances, who hit a batter and allowed a single, struck out Jarrod Dyson swinging at a curveball.

Chapman walked a batter, threw a wild pitch and allowed a two-out double for the Mariners’ first run.

“It’s something that we’re trying to get straightened out,” Girardi said of Betances and Chapman’s recent troubles, mostly command issues. “In the long-term, no [there’s no concern], but right now, yeah, we’re trying to get them right.”