The Mets' Ruben Tejada reacts after hitting an RBI single...

The Mets' Ruben Tejada reacts after hitting an RBI single to score Juan Lagares to win the game in the 11th inning against the Atlanta Braves at Citi Field on Monday, July 7, 2014. Credit: Kathleen Malone-Van Dyke

For seven innings, the Mets' Daisuke Matsuzaka engaged in a gritty pitching duel with Braves starter Mike Minor, who allowed only two hits but left trailing by two runs. But when the bullpens for both teams got involved, things turned chaotic.

First, three Mets relievers ruined Dice-K's shutout by giving up three runs in the top of the eighth. Then Braves reliever Luis Avilan allowed a tying home run by Curtis Granderson in the bottom of the inning.

It finally ended when Juan Lagares hit a one-out double in the 11th, moved to third on a flyout and scored on Ruben Tejada's single up the middle to give the Mets a 4-3 victory before a mere 20,836 fans Monday night at Citi Field.

It was the fifth walk-off win of the season for the Mets and first since May 11 in Philadelphia, when another Tejada single produced the winning run. This time Tejada drilled a shot up the middle past Braves reliever Anthony Varvaro.

"I'm looking for good contact and staying in the middle of the field," Tejada said.

Coming off a similar loss last week in Atlanta, manager Terry Collins said this was a win the Mets had to have, "especially the way the eighth inning turned out . . . We needed it bad.

"There's an excited clubhouse. We beat the Braves when they're playing great."

The top of the eighth was a nightmare for the Mets' bullpen. Freddie Freeman hit a one-out double off Vic Black, moved to third on a groundout and scored on a wild pitch by Josh Edgin, who then allowed a single by Jason Heyward, the only batter he faced.

That brought in Jenrry Mejia to attempt a four-out save, but Chris Johnson's double drove in Heyward with the tying run. After an intentional walk, Mejia allowed an RBI single by Christian Bethancourt for a 3-2 Braves lead.

But Avilan coughed it up on a 3-and-2 pitch with two outs in the bottom of the eighth when Granderson connected with a 95-mph fastball. "I was trying to get something around the plate that I could do something with," he said. "I was finally able to get a pitch down the middle that I could handle and drove it out of the park."

The Mets loaded the bases with two outs in the bottom of the ninth, but Eric Young hit into a force play that sent the game to extra innings tied at 3.

An unusual replay ruling had kept the Mets in the inning. Eric Campbell singled and originally was called out at second on Lagares' bunt, but Collins challenged the call. The replay showed Andrelton Simmons came off the bag too soon when he took the throw from Johnson and relayed to first, and after the umpires overturned the call, Braves manager Fredi Gonzalez was ejected. "Neighborhood plays'' are not reviewable, but this play was reviewed because it was ruled that Johnson's throw "took the fielder off the bag,'' umpire Mike Everitt said. Three subsequent forceouts got the Braves out of the inning.

Matsuzaka got cuffed around early by the Braves but allowed only one runner to reach third base while holding them scoreless for seven innings. The Mets provided two hits of support, but they were big -- Travis d'Arnaud's RBI double in the second and David Wright's homer in the third, both with two outs.

"It's difficult to pitch an entire game without going through some trouble," Matsuzaka said. "But today is the type of game I've been striving for. That's the type of game I want to pitch."