Just when he was getting comfortable as a reliever, Daisuke Matsuzaka stepped into the breach and served as the ultimate stopper for the Mets on the mound and even at the plate.

Matsuzaka pitched six innings and delivered a run-scoring single in a 4-2 win over Arizona in the second game of a doubleheader Sunday at Citi Field as the Mets avoided a sweep by the Diamondbacks.

New closer Jenrry Mejia got the save, making his second appearance of the day after taking the loss in the opener, thanks to a fielding error on what would have been the third out in the ninth inning of a tie game.

The Mets suffered a 2-1 loss in the opener when they stranded 10 runners, hit into five double plays and let the go-ahead run score on second baseman Daniel Murphy's error. They wasted a quality performance by starter Rafael Montero, who allowed one run and two hits and struck out 10 in six innings.

Matsuzaka (2-0) has made a successful transition from the starting rotation to the bullpen this season. He pitched a scoreless inning in Thursday night's win over the Dodgers and had allowed one earned run in his previous 102/3 innings. But after Friday's rainout, Matsuzaka told manager Terry Collins that he was available to start Sunday's nightcap and could give him 100 pitches.

Matsuzaka delivered on his promise, leaving the game after six innings and 98 pitches, having allowed two runs, three hits and a walk with six strikeouts.

"It's a tremendous lift to everybody,'' Collins said. "To do the job when he hasn't been lengthened out shows what kind of heart he's got.''

Matsuzaka gave up both runs in the second on Aaron Hill's leadoff single, a triple by Martin Prado and an RBI groundout. In the next four innings, Matsuzaka allowed just one more hit.

"I haven't thrown this many pitches in a while, and I didn't know how my body would respond,'' he said. "I was confident I could get through it . . . I was given the ball with the expectation I would pitch deep into the game. I would have liked to pitch into the seventh inning.''

When Matsuzaka left, the score was tied at 2, and it was his bloop single in the second that drove in Wilmer Flores from second for the Mets' first run. "I'm pretty confident in my hitting,'' Matsuzaka said with a laugh. "I just wanted to get the run in.''

Bobby Abreu's run-scoring double in the fifth tied it, and the Mets put Matsuzaka in position to get the win when Anthony Recker, who had a career-high four hits, doubled in the sixth and scored on a single by Reuben Tejada, pinch hitting for Matsuzaka. The Mets added an insurance run in the eighth when Chris Young drew a walk, was sacrificed to second and scored on Murphy's single.

Mejia (4-1) came on for the save, allowing one hit and striking out one. He had been saddled with the opening loss when Murphy dropped a relay from David Wright, allowing A.J. Pollock to score what proved to be the winning run in the top of the ninth.

Since his move to the bullpen, Mejia pitched for a second consecutive day for the first time on Thursday. Asked how it felt to pitch twice in the same day three hours apart, he said, "It's very hard. This is my first time. When they call me and say, 'You have ninth inning,' I say, 'Unbelievable.' I never pitched like that.''

It was a new sensation, but Mejia is quickly adapting to the closer role.

"Now I want to be in that role,'' he said. "If they want me to be there, I've got to want to be there, too. There's no pressure. I mean, it's just one inning.''