Trailing 3-1 in the seventh, the Mets got Ruben Tejada aboard with two outs and Lagares followed by smashing his first major-league homer deep into the left-fielder bleachers for a game-tying home run off Chicago starter Travis Wood.
In the next inning, Murphy belted a 2-0 pitch from Kyuji Fujikawa (1-1) into the right-field stands for the decisive blow -- his fourth homer at Wrigley Field in two years.
Reliever Scott Rice (2-3) earned the win as the Mets bullpen fired four shutout innings.
Bobby Parnell recorded his sixth save for New York, which won its three-game series.
Wood allowed three runs over seven innings and hit a two-run homer for Chicago.
Ryan Sweeney went 2-for-3 with a solo home run for the Cubs.
Benedict Cumberbatch's dramatic reading of R. Kelly lyrics is just what you need
Jordana Brewster on Paul Walker: 'He was an enormous presence in my life'