The Mets used a two-run single from Josh Satin in the eighth to knot the score 3-3 and send the contest into extra innings.
Maxwell -- obtained Wednesday in a trade with the Houston Astros -- came up to bat for pitcher Kelvin Herrera in the 12th and lined a pitch from David Aardsma (2-1) just inside the left-field foul pole for the go-ahead run.
Herrera (4-5) got credit for the victory with three scoreless relief frames and Greg Holland secured the with win with a 1-2-3 bottom of the 12th for his 29th save.
Miguel Tejada went 3-for-4 with an RBI for Kansas City, which rebounded from an 11-inning, 4-3 loss to the Mets in Friday's series opener.
Daniel Murphy socked a solo homer for New York.
Megyn Kelly: Santa Claus and Jesus are both white men
Video of Victoria’s Secret models trying to 'twerk' hits Instagram