NEW YORK — A.J. Ellis didn’t wait long to endear himself to the Philadelphia Phillies. All he needed was three at-bats.

Ellis got a big hit in his Philadelphia debut, breaking a seventh-inning tie with a two-run double Sunday that sent the Phillies to a 5-1 victory over the New York Mets.

Philadelphia salvaged the series finale after getting outscored 21-5 in the first two games.

“Regardless of what’s happened the last four days, it feels good to drive in runs,” Ellis said. “It feels good to help put your team ahead and contribute to a team win.”

Ellis was acquired Thursday from the Los Angeles Dodgers in a trade for longtime Phillies catcher Carlos Ruiz. The veteran backstop, the longest-tenured Dodgers player in the organization at the time of the deal, arrived Saturday and started getting to know his new teammates and pitching staff.

“We heard about his disappointment in L.A., but the minute he got here and I talked to him, he put it behind him, he was fine,” Phillies manager Pete Mackanin said. “It was great to see him get that big hit, for himself and for the team. I’m sure he feels more comfortable now.”

Ellis didn’t just help at the plate. He guided young starter Vince Velasquez and four relievers as they quieted a streaking Mets lineup that was minus ailing sluggers Yoenis Cespedes (quad) and Neil Walker (back).

“It was a lot more fun catching those guys than hitting against them,” Ellis joked.

New York also lost shortstop Asdrubal Cabrera in the first inning. He exited with soreness in his left knee, a problem area that sidelined him twice earlier this year.

Mets manager Terry Collins indicated that his three injured players might require daily checkups for the remainder of the season.

“We’ll have to continue to monitor how they feel each day,” he said. “But with the way all of a sudden we’ve played here in the last four or five days, it took a little air out of the balloon.”

The score was 1-all in the seventh when Philadelphia loaded the bases with nobody out on singles by Tommy Joseph, Aaron Altherr and Jimmy Paredes off Robert Gsellman (1-1), who was very effective to that point in his first major league start.

Hansel Robles came on in relief and Ellis drove the right-hander’s fourth pitch over Curtis Granderson’s head in left field, scoring Joseph and Altherr with his first hit for his new team.

Ellis struck out and grounded out in his first two at-bats.

Pinch-hitter Peter Bourjos was hit by a pitch from Robles with the bases loaded, forcing in another run.

Cesar Hernandez added a sacrifice fly to make it 5-1.

David Hernandez (3-3) pitched a scoreless inning for the win.

Philadelphia squandered two chances to score early in the game, when Freddy Galvis was thrown out at home on a failed squeeze attempt and Altherr was cut down at the plate on Paredes’ fourth-inning RBI double.

Velasquez allowed five hits in five innings while striking out seven. The 24-year-old right-hander had struggled of late, allowing 19 runs and 25 hits over his previous 16 1/3 innings. But he improved on his success against the Mets, lowering his ERA versus New York to 1.76 (three earned runs in 15 1/3 innings).

“Talking to A.J. when he got here, and just today before the outing, he was like, ‘Just trust your stuff,'” Velasquez said.

Philadelphia had lost the previous seven games Velasquez started, dating to July 19.

“At (24) years old, he’s got a lot to learn, but he’s got the stuff to be really good,” Mackanin said.

The Mets entered having scored 31 runs over their last three games, including three homers by Cabrera during that span.

TRAINER’S ROOM

Phillies: Bourjos was hit by a 97 mph fastball on the left wrist. After crouching down in pain behind home plate, he went to first base.

Mets: LHP Steven Matz (shoulder) threw a bullpen and is expected to throw another one before coming off the disabled list to start Thursday against Miami rather than Wednesday, Collins said.

UP NEXT

Phillies: RHP Jake Thompson (1-3, 9.78 ERA) opens a three-game series against NL East-leading Washington, his fifth major league start. He’s failed to reach the sixth inning in any of his previous four. Tanner Roark (13-7, 2.99 ERA) pitches for the Nationals.

Mets: RHP Rafael Montero (0-0, 11.57 ERA) has the difficult task of facing All-Star RHP Jose Fernandez (13-7, 2.91) in his first big league start of the season as the Mets begin an important four-game series with Miami at Citi Field. Montero will be recalled from Double-A Binghamton on Monday and last pitched in the majors on April 19. He struggled at Triple-A Las Vegas, but had a 1.70 ERA in eight starts at Binghamton.