It was just another magical moment for the Dodgers, and it came on ownership partner Magic Johnson's birthday.
"I can't explain what's happening here, but it's fun," said Dodgers manager Don Mattingly.
Puig started the winning rally with a double, and Gonzalez brought him home on the first pitch he saw from left-hander Pedro Feliciano for the Dodgers' sixth walk-off win of the season.
"There's nothing better," said reliever Paco Rodriguez, who fired 1 1/3 scoreless innings to earn his third win. "We've always got a shot."
Mark Ellis began the comeback in the ninth with a leadoff single. One out later, Andre Ethier crushed a pinch-hit, two-run shot to left to tie the game at 4.
"It's on par for what's going on with this team," Ethier said. "It's not the same hero every night. It's someone different stepping up when they're name is called. It's a nice sign."
Ethier was out of the starting lineup Wednesday for the second straight game, the result of a left calf issue that has bothered him for over a week. The outfielder was rushed to a local hospital before Tuesday's game, and the Dodgers feared he had a blood clot. Fortunately, that wasn't the case.
Ethier's home run was his eighth of the season and his first since July 23 in Toronto. Even more impressive was the fact that Ethier's blast went to the opposite field, no easy feat late at night at Chavez Ravine.
"That's pretty amazing what happened right there," Mattingly said. "That was huge."
The Dodgers have won their past 12 games decided by one run, a franchise record.
"We're going to battle and our bullpen keeps us in games," Ellis said.
Carlos Marmol entered with two outs in the ninth and gave the Dodgers two scoreless innings for his longest relief outing since April 22, when he was with the Cubs. Marmol walked off the field to a standing ovation.
"It was a great feeling," Marmol said. "It was big for me. I'm glad that I'm here. It's fun every day. You come to the ballpark and you know you're going to win."
Chris Withrow kept the Mets off the board for two frames, J.P Howell fired another scoreless inning, and Brandon League recorded two outs. Another game, another solid effort from the bullpen.
The Dodgers came from six runs down to beat the Rays on Friday to set the tone for a six-game homestand sweep. They now have swept three of their past four series.
"They're playing good, and they pitched very, very well," said Mets manager Terry Collins. "You look at what they did -- each game we got out early and never got anything after that. They pitched very well and that's about it."
Did Friday's comeback, which included four runs in the ninth, feed into Wednesday's outcome?
"Absolutely," Ellis said. "It just gives you confidence that you can do it."
Los Angeles is 23-3 in the second half and 40-8 since June 22, the best 48-game stretch in the Majors since 1942, when the Cardinals won 41 of 48 games. The Dodgers have become the hottest ticket in town, and Wednesday's star-studded crowd of 44,091 featured Kanye West, George Lopez, Robin Thicke, Wheel of Fortune host Pat Sajak and former Lakers forward Robert Horry.
The Dodgers were in an early hole after starter Chris Capuano allowed four runs in five innings.
Capuano, who has been up and down this season, did not have his best stuff Wednesday night. Since coming off the disabled list June 19, Capuano has five scoreless outings and five starts allowing at least four earned runs. He allowed 10 hits for the second straight start, and his ERA rose to 4.66.
But the bullpen picked up Capuano with seven scoreless innings.
"It's hard to even give them enough praise," Capuano said. "They gave us a chance to come back. It was another outstanding effort."
Hanley Ramirez did not appear limited by a sore right shoulder in his first start since Aug. 4. The shortstop scored a run and had two hits, including a double. He was smooth defensively and made two accurate throws to first.
Ellis and Jerry Hairston each had RBIs during the sixth inning, when the Dodgers finally broke through against Mets starter Dillon Gee.
Puig threw out Mets outfielder Marlon Byrd trying to advance to third on a single in the second inning. Puig's laser throw from right field was on the money, beating Byrd to the bag.
Puig's sixth outfield assist of the season helped save a run, but the Mets scored two batters later on a double by Andrew Brown. Byrd got his revenge in the next inning, belting a 3-0 pitch from Capuano into the left-field bleachers for a three-run shot.