He added another goal later in the game.
Villa, 36, now has 68 goals for NYCFC since joining the Major League Soccer franchise from Atletico Madrid in 2014. The only club that Villa has scored more goals for is Valencia, where he netted 129 times across all competitions from 2005-10.
The Spain international has 59 goals forLa Roja, including goals in the round of 16 and quarterfinals in the team's 2010 World Cup-winning run, and has also scored 48 times for Barcelona, 41 for Sporting Gijon and 15 for Atletico Madrid.
The milestone puts Villa in some elite company, joining Cristiano Ronaldo (647), Lionel Messi (603), Zlatan Ibrahimovic (430), Luis Suarez (411), and Samuel Eto'o (404), on the list of active players to have reached the 400-goal mark.
Along the way, Villa has 84 multi-goal games, including 10 hat tricks.
WATCH: David Villa's 400 goals by the numbers
David Villa joined elite company in NYCFC's win over FC Dallas, becoming the sixth active player to reach 400 career goals for club and country.