PHILADELPHIA — Todd Frazier hit a pair of three-run homers and tied his career best with six R.B.I., and the Mets beat the Philadelphia Phillies, 11-5, on Friday night, ending a six-game losing streak.

Michael Conforto also went deep for the Mets, who also broke a six-game losing streak in Philadelphia.

The Phillies fell three and a half games behind the Cubs for the second wild-card spot in the National League. The Mets are five games back.

Mets starter Zack Wheeler and Aaron Nola, the Phillies’ ace, pitched well before turning it over to the bullpens. Philadelphia’s imploded, allowing 10 runs while recording eight outs.