Somerset scored first in the bottom of the fourth on an RBI base hit by Eddy Martinez-Esteve for the 1-0 lead.
A solo homerun by Luis Montanez (6) in the bottom of the sixth tacked on another run for the Patriots and increased their lead to 2-0.
York got on the board in the seventh after Cody Johnson drove an RBI single to right field to cut the lead to 2-1.
Patriots starter David Harden (7-1) picked up the win, allowing a run on four hits and six strikeouts in 7.2 innings pitched. Pedro Liriano (2-1) suffered the loss, allowing a run on five hits in 5.1 innings pitched. Jon Hunton came on in the ninth and pitched a scoreless inning for his 16th save.
The 2013 Somerset Patriots season presented by Ford will continue at home on Thursday evening when the Patriots take on the York Revolution at 7:05 pm. The first 1,500 kids will receive a Baseball Bank courtesy of the NJEA. For tickets, call (908) 252-0700 or visit www.somersetpatriots.com.