Juan Nicasio #12 of the Pittsburgh Pirates pitches in the first inning ( Justin K. Aller/Getty Images)

Juan Nicasio retired his first 12 batters and got his second win in six starts, and the Pittsburgh Pirates beat the New York Mets 3-1 on Tuesday night to complete a doubleheader sweep.

The Pirates also won the first game 3-1 behind seven scoreless innings from Jon Niese against his former team. Josh Harrison had three hits and Jordy Mercer hit his first home run at PNC Park since Aug. 31, 2014 in the first victory.

Nicasio (5-4) allowed a run on three hits and two walks over five innings. He had gone 1-2 with a 6.23 ERA in his previous five starts, and manager Clint Hurdle acknowledged last week that he was considering moving the right-hander to the bullpen.

Jacob deGrom (3-2) is winless in his last seven starts after he allowed three runs in six innings with nine strikeouts and no walks. He has not won since April 30 against San Francisco despite allowing three earned runs or fewer six times.

Sign up for the NJ1015.com Newsletter

Get the best of NJ1015.com delivered to your inbox every day.

(Copyright 2016 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed)