PHILADELPHIA — Inactivity can be a funny thing, especially in an endeavor as reliant on rhythm and routine as baseball. Pauses in the schedule, even ones as welcome as the Midsummer Classic, can wreck timing.

“You never know what the first game after the All-Star break is going to be like,” Mets second baseman Neil Walker said.

Nevertheless, the Mets trudged through their first day after the All-Star break in much the same way that they soldiered on in the days leading up to it.

Manager Terry Collins took stock of which players were healthy and which were not, then watched the Mets beat the Phillies, 5-3, on Friday night despite fielding a lineup compromised by injuries.

Even after a seven-day hiatus, Yoenis Cespedes still felt pain in his strained right quadriceps, forcing Collins to leave him out of the starting lineup. But the Mets (48-41) got a boost from Walker and Juan Lagares.

Walker’s three-run homer off right hander Jeremy Hellickson in the sixth gave the Mets a 4-0 cushion. Lagares hit a solo homer in the third and helped manufacture a key run in the seventh.

advertisement | advertise on newsday

“That’s the kind of player that he can be,” Collins said. “He can really run.”

It was enough to support 43-year-old Bartolo Colon. Just as he had done throughout the season’s first half, he kept the Mets in the game, allowing three runs (all unearned) in 5 2⁄3 innings.

“I got a little tired, and that’s when things got a little complicated,” said Colon (8-4).

Closer Jeurys Familia made quick work of the Phillies in the ninth. Well-rested after being held out of the All-Star Game, Familia nailed down his 32nd straight save to start the season, capping a stellar night for the bullpen. Hansel Robles, Jerry Blevins, Addison Reed and Familia combined to throw 3 1⁄3 scoreless innings.

Lagares gave the Mets a 1-0 lead with his third homer of the season. But the big blow came from Walker, who lined a 3-and-2 pitch the other way for his 16th homer, equaling last year’s season total.

Mets videos

Colon retired the first 13 batters he faced, needing only 15 pitches to cruise through his first two innings. But it wasn’t until the sixth that he looked unsteady, and even then, it was a poor throw by typically steady first baseman James Loney that set things in motion.

After making a nice play to field Odubel Herrera’s grounder, Loney’s feed to Colon at the bag sailed high and out of the pitcher’s reach. Peter Bourjos followed with a run-scoring triple and scored on Maikel Franco’s groundout. Two batters later, Cody Asche hit a run-scoring single into shallow leftfield, cutting the Mets’ lead to one run.

With that, Colon was chased from the game, though Robles ended the threat by getting Freddy Galvis to hit an inning-ending pop-up.

Lagares delivered an insurance run and did it in a fashion that has been nearly foreign to the grip-it-and-rip-it Mets. He produced the tally with his legs.

Lagares worked a leadoff walk, then swiped second and went to third when Alejandro De Aza flied out to the warning track in right.

advertisement | advertise on newsday

When Jose Reyes hit a grounder to Galvis at short, Lagares alertly ran on contact. Even though Galvis was playing in and uncorked a throw that was good enough to make the play close, Lagares scored to make it 5-3.

“I know I can run a little bit,” he said. “When I have a chance, I want to take advantage of it.”