PITTSBURGH -- When the Pirates need a stopper, they call Paul Maholm.

When they need offense, they call the Mets' bullpen.

Pittsburgh scored five unanswered runs against New York relievers on Monday to salvage the last game of the four-game set, 5-2, at PNC Park and ended a four-game losing streak.

"It's been a tough stretch the last couple weeks," said Jack Wilson, who collected two hits and two RBIs on Sunday. "Obviously, it's going to be a tough series when you're playing four against the Mets. Just to get the last one and kind of take a deep breath and try to get back on track [was nice]."

Attendance for Monday's game was 19,066, which brought the total attendance for the four-game series up to 129,473. That mark beats the previous record of 129,066 set from Sept. 20-23, 2001, against the Cardinals.

The three consecutive sellouts against the Mets make eight for the season -- the most for the Pirates since posting eight sellouts in 2005.

Those fans saw the Pirates struggle against Mets starters the entire series, collecting only one run and 20 hits. Against the relievers, however, the Pirates tallied nine runs and 14 hits.

The decisive blow came off the bat of Steve Pearce, who singled in Adam LaRoche with the winning run in the eighth. The play sparked a three-run rally and helped end the Bucs' recent seven-game homestand with a 2-5 record.

It was the second game-winning hit for Pearce against the Mets in the last eight days. The right fielder connected on a line-drive single, scoring two, in the Pirates' come-from-behind win on Aug. 11.

"He took a little something off of it," said Pearce, who delivered the hit after the Mets intentionally walked Andy LaRoche to get to him. Pearce sent the first offering he saw squeaking past David Wright at third.

"I was looking for something I could put good wood on," Pearce said, "and I got my pitch and did something with it."

Reliever Sean Burnett picked up the win, his first since his rookie year in 2004. It was icing on the cake for the left-hander, who was cut on the last day of Spring Training -- which also happened to be the same day as the birth of his first child.

And after surgery in 2005 and working his way back to Major League-ready shape, Burnett can finally sit back and say it was all worth it.

"It's all paid off today," he said. "This might be a little more special than the first one I got because of the last few years and how hard it's been to get back to this level."

It was also one of his quickest wins after pitching only one-third of an inning on Sunday. He got Carlos Delgado to pop out to first with the bases loaded in the eighth.

Maholm, despite not having his best stuff, went a strong seven innings for the 12th time this season. He left the game after Chris Gomez pinch-hit for him in the seventh, but Maholm was able to limit the Mets to five hits and two runs. He struck out four and walked three.

When the southpaw got in trouble, the Bucs' defense bailed out Malhom with two fancy double plays. What was even more impressive was Maholm's ability to limit the Mets' offense after it scored a first-inning run.

"I think, in years past, it probably would've gotten ugly in the first if that had happened," Maholm said. "This year, I'm confident to where I can make my pitches and I can get ground balls and a strikeout if I need to and not let the inning get out of hand."

Adam LaRoche brought in the Pirates first two runs with his 16th home run of the year to right field in the sixth.

Wilson followed Pearce's hit in the eighth with a two-run double, scoring Jason Michaels and Andy LaRoche. From there, John Grabow closed out the game and picked up his fourth save of the year in the ninth.

"It was a nice win for us," manager John Russell said. "We're starting to swing the bats a little better, but we still got some things to work on offensively."

The win was also the Bucs' 29th comeback win of the year.

"We've been doing that," Pearce said. "We're always in the game. We're always within striking distance. If they let us hang around long enough, we have good enough bats to come back with. As long as our bullpen kept us in the game and our starting pitching did, we have the ability to get it done."