Brett Baty and Tommy Pham had two RBIs apiece for the Mets, who have won consecutive games for the first time since sweeping a three-game series from the Philadelphia Phillies from May 30 through June 1
Francisco Lindor lofted a sacrifice fly and Daniel Vogelbach snapped a slump with a homer as New York improved to 4-9 this month.
Willson Contreras homered in the fifth for the reeling Cardinals, who are 2-11 in June
Megill (6-4), who entered Friday 0-2 with an 8.64 ERA in his previous four starts, allowed four hits, including Contreras' homer, and walked none while striking out seven over six innings. It was his longest outing since May 18 and only the second time this season he allowed one run or fewer over six innings.
Dominic Leone allowed a hit in the seventh and Josh Walker struck out three over two perfect innings.
Miles Mikolas (4-4) took the loss after allowing all six runs on eight hits and one walk while striking out one over six innings. The right-hander almost wriggled out of a bases-loaded, non-out jam in the first by getting Francisco Lindor to hit into a 1-2-3 double play, but Baty followed with a two-run double down the first-base line and Pham singled Baty home two pitches later.
The Mets extended their lead to 5-0 in the third, when Starling Marte and Jeff McNeil led off with singles before Marte scored on Lindor's fly out to left. McNeil raced home on Pham's two-out RBI single
Vogelbach, who entered Friday batting .120 since his previous homer on May 7, launched a shot into the second deck in the sixth.
--Field Level Media