As the Subway Series began at Citi Field on Monday night, the Mets and Yankees were on decidedly different tracks.

It was the win-now Mets vs. the rebuilding Yankees.

Who would’ve thunk it?

In a game that started about three hours after the Yankees traded away Carlos Beltran and the Mets acquired Jay Bruce, the Yankees scored two in the eighth inning to tie and one in the 10th for a 6-5 victory before a sellout crowd of 42,125.

After the Yankees loaded the bases with none out in the 10th, Starlin Castro drove in the go-ahead run with a one-out sacrifice fly off Seth Lugo.

Instead of a championship banner, the Yankees have raised the white flag. But for one night at least, they battled the defending National League champions as if it were a playoff game and snapped a four-game losing streak.

advertisement | advertise on newsday

“We’ve got a lot of guys in here that take a lot of pride in what they do,” Brett Gardner said. “Obviously, we put management in a tough position and we are where we are now. These are the cards we’re dealt and we’re going to do the best we can with it.”

Just like the day, the game started and ended with drama. Gardner led off the first inning by trying for an inside-the-park home run on a drive to right-center, but he was thrown out at the plate by Neil Walker. “The crowd was loving it,” Gardner said. “Both Yankees and Mets fans are loving it because it’s action right off the bat.”

And it ended when new Yankees closer Dellin Betances escaped a first-and-third, one-out situation, striking out former Yankee Curtis Granderson with runners on second and third for his first save of the season. No Yankee has taken the team’s tear-down harder than Betances, who will have to carry on without the traded Aroldis Chapman and Andrew Miller. “Obviously, it’s been a tough week for us,” he said. “We lost some unbelievable guys in the clubhouse.”

Mets videos

The latest was Beltran, whom the Yankees traded to the Rangers on Monday. They also shipped Ivan Nova to the Pirates to conclude a selloff that began with the trades of Chapman and Miller. They all went for prospect buds that Brian Cashman hopes will flower into the next Yankees dynasty.

“There’s no shame,” Cashman said. “We’ve been contending for a long, long time and we are damn proud of that . . . It turned out to be us on the selling side.”

The Mets, who are coming off a World Series appearance and desperately want to get back, shored up their struggling offense before the 4 p.m. deadline with the pickup of rightfielder Bruce from the Reds for two prospects, including prized second baseman Dilson Herrera.

Bruce joins a crowded outfield — at least at the corners. The Mets will have to figure out what to do with centerfield when Bruce arrives Tuesday. “As people I’m sure will comment, it’s not an absolute perfect fit for us,” general manager Sandy Alderson said. “We start with the need for offense and work from there.”

The Mets also re-acquired old friend Jon Niese from Pittsburgh for Antonio Bastardo. Niese will report to the bullpen.

advertisement | advertise on newsday

The result of the whirlwind of deadline-day activity was an all-Gotham battle that seemed like an afterthought but ended up being as exciting as a game can be from first batter to last.

The Yankees were leading 3-2 in the sixth when Mets rookie Matt Reynolds hit a three-run homer off CC Sabathia. Reynolds was called up earlier in the day to fill in for shortstop Asdrubal Cabrera, who is headed to the disabled list with a knee injury.

The Yankees tied it in the eighth when Didi Gregorius floated a two-out, two-run single to left off Addison Reed, who had not allowed a run since June 25.