By Sam Bush

Amed Rosario hit a tie-breaking, solo shot leading off the ninth inning and the New York Mets beat the Phillies 7-6.

After Cesar Hernandez hit a tying, solo homer in the eighth off Jerry Blevins, Rosario connected off Phillies closer Hector Neris (4-5) to cap a three-hit night. The rookie shortstop entered the game batting .161 (5 for 31).

Phillies starter Nick Pivetta (4-8) allowed six runs — five earned — and seven hits in 4 2/3 innings.

The Phillies jumped ahead 3-0 in the first inning. Nick Williams (above) and Tommy Joseph had RBI singles.

Conforto led off the second with an opposite-field drive to left-center for his 25th homer.

Cespedes gave the Mets a 4-3 lead in the third when he blasted a 429-foot drive to left for his 13th homer. He has nine homers and 23 RBI in 17 games at hitter-friendly Citizens Bank Park.

Joseph answered with an RBI double in the bottom half to tie it at 4.

The Mets are 5-0 against the Phillies in Citizens Bank Park and have 17 homers in those games while the Phillies have just four.

“We just can’t see to outdo them,” Phillies manager Pete Mackanin said.