New York: New York Yankees captain Derek Jeter is doing everything he can to extend his last Major League Baseball campaign.

Jeter drove in three runs on Monday in the Yankees’ 5-0 victory over American League East division winners Baltimore — helping keep the Yankees’ faint hopes of a wild card berth alive.

Jeter delivered an RBI groundout in the third inning and a two-run double in the fifth.

With adoring fans hanging on his every move, Jeter’s big night overshadowed a stellar performance from New York starting pitcher Michael Pineda, who dominated Baltimore’s hitters over seven and one-third innings to help the Yankees win for the fifth time in six games.

Pineda surrendered just one hit — a fifth-inning single to JJ Hardy — and a walk while striking out eight.

Jose Pirela drove in a run with a triple in his first major league at-bat and finished 2-for-3 with two runs scored to boost the Yankees’ cause.

Chase Headley also collected a brace of hits, including a solo homer.

Nevertheless, the Yankees still trail the Kansas City Royals by four games for the American League’s final wild card berth with six games to play.

Yankees manager Joe Girardi is already planning Jeter’s exit from what is likely to be his last game at Yankee Stadium when the series against the Orioles concludes on Thursday.

Girardi orchestrated a poignant departure for closing pitcher Mariano Rivera last year, sending Jeter and pitcher Andy Pettitte to the mound to execute the pitching change that let Rivera leave the field to an ovation from fans.

Girardi acknowledged that it could be tougher to focus on the moment if the Yankees are battling for a playoff spot. In addition, Jeter has indicated he will play the Yankees’ last three games of the season at Boston.

“It’s different in a sense with Derek, because you don’t know where you’re going to be at and the meaning of the game at that point,” Girardi said.

“I’ll just kind of wait and see how it goes, and we’ll make a decision when it’s time, I guess.”

Jeter, meanwhile, is trying to stay focused on playing the game, even as his 20-year big-league career — all with the Yankees — is celebrated.

He’s featured in a heart-tugging television commercial for sponsor Gatorade, which shows him delighting fans with handshakes and autographs as he makes his way on foot to Yankee Stadium — all to the strains of Frank Sinatra singing “My Way.”

Before Monday’s game Jeter appeared at the Hudson Theatre, taking part in a question-and-answer session with memorabilia mogul Brandon Steiner with whom he has a business deal.

“I’m trying not to reminisce yet,” Jeter said. “I play a game where you’re supposed to control your emotions. It’s a game of failure.

“You’re going to fail more than you’re going to succeed. You have to be able to control it. At times this year, it’s been difficult. You go places and they show a video montage and you feel as though you’re dying.”

Then he went to the ballpark, and showed just how much life is left in him, with his first three RBI game since 2012.