Down 2-1 entering the frame, the Mets began a comeback against Cory Gearrin (1-1) when pinch-hitter Justin Turner led off with a single. One out later, Lucas Duda cracked a ground-rule double, putting runners at second and third.
John Buck followed with a score-tying single, sending Duda to third.
Gearrin then hit pinch-hitter Mike Baxter with a pitch, loading the bases, and Davis sent a solid base hit into right field for the decisive blow.
Bobby Parnell picked up his seventh save as New York snapped a five-game skid.
Dan Uggla belted a two-run homer for National League East-leading Atlanta, whose eight-game winning streak was halted.