Gonzalez (19-7) overcame five walks, allowing three hits while striking out six en route to becoming the major leagues' first pitcher to reach 19 wins.
The left-hander benefited from a pair of double plays turned behind him as the National League East-leading Nationals took the opener of a three-game series.
Collin McHugh (0-2) was tagged with the loss, surrendering five runs (two earned) on five hits in four frames.
Scott Hairston went deep for New York.
Dennis Rodman pledges to end trips to North Korea
Interpol investigating stolen passports on missing flight