David Villa scored his league-leading 16th goal of the season early in the first half, and New York City was able to protect a one-goal lead for more than 85 minutes to secure a victory over the Galaxy, who are in the hunt for a playoff spot in the Western Conference.
New York City improved to 11-7-8 and will remain atop the table in the Eastern Conference.
The Galaxy, who were making their first appearance in Yankee Stadium, fell to 9-4-11 and saw their nine-game unbeaten streak snapped.
Villa's goal came six minutes into the match. Defender Ronald Matarrita got off a shot from the top left corner of the box.
Galaxy keeper Clement Diop came off the line and deflected Matarrita's shot, but Villa collected the rebound and punched it home.