Updated

Wildly streaky from week to week, Daniel Murphy is on the right side of the ledger again.

Murphy had a pair of doubles among his four hits to go with two runs scored and an RBI in the New York Mets' 5-2 win over the St. Louis Cardinals to avoid a sweep in the finale of a four-game set.

After a terrific start to the year, Murphy fell into an 0-for-17 slide, but has responded by going 10-of-16 since with four doubles.

"When he gets it going, he can be very dangerous," Mets manager Terry Collins said of Murphy.

Murphy had an unusual ground-rule double in the sixth when he scalded an Adam Wainwright offering that stuck into a gap between the two conjoining walls in the right field corner.

David Wright registered two hits, two RBI and a run scored, while Jonathon Niese (3-4) surrendered two runs on six hits and two walks over 7 1/3 frames for the Mets, who snapped a six-game losing skid.

Bobby Parnell notched his fourth save after working around a two-out single in the ninth.

Wainwright (5-3) took a no-hitter into the eighth in his last start, but quickly allowed a one-out single to Murphy in the first. He fanned eight, but allowed four runs -- three earned -- on six hits and a walk over six innings for St. Louis, which had won six of its last seven tilts coming in.

"He was fighting from the beginning," Cardinals manager Mike Matheny said of Wainwright. "He was pretty good, but you could see he was laboring."

Pete Kozma's RBI double got the Cardinals on the board in the second, but the Mets countered by plating a pair in each of the third and sixth frames and added another in the eighth to surge ahead.

Jordany Valdespin ignited a two-out rally in the third with a bunt single and Murphy drove him in when he laced a double into the right field corner. Murphy advanced to third on the relay throw to the plate and scored on Wright's single to right.

Murphy led off the sixth with a double and Wright brought him home when he ripped a two-bagger into the gap in right center. Wright scurried to third on the play after the center fielder Shane Robinson one-hopped his throw past the cutoff man. He crossed the plate on Lucas Duda's sacrifice fly to center two batters later.

John Buck's RBI single up the middle made it 5-1 in the eighth.

Carlos Beltran's run-scoring single cut the deficit to 5-2 in the home half, but with runners on first and second with one away, Brandon Lyon induced Allen Craig into an inning-ending 5-4-3 double play.

Game Notes

Niese moved to 3-1 in his career against the Cardinals ... Murphy has 13 doubles on the year ... The Mets were 4-for-10 with runners in scoring position ... New York's Ike Davis went 0-for-5 with four strikeouts.