LOS ANGELES -- The entire dugout erupted, players throwing up their arms and jumping in the air.

Matt Kemp has barely played in this stretch, but he was as loud as anybody. He screamed and ran the length of the dugout to where manager Don Mattingly was standing. Clayton Kershaw yelled and jumped off the top dugout step toward the bench.

Andre Ethier watches as his ninth-inning home run heads toward the left-field pavilion to tie the score Wednesday. The Dodgers won in 12. Joe Scarnici/Getty Images

Yasiel Puig ran onto the field to get a quick hug from Andre Ethier, who nearly took off Mattingly's hand with his high-five.

And that was just the tying run.

Ethier's dramatic pinch-hit blast tied it in the ninth, and then the Dodgers beat the New York Mets 5-4 in the 12th for their eighth straight victory.

Puig threw up his arms again about an hour later, after his grounder up the middle glanced off diving shortstop Omar Quintanilla and trickled into center field. Puig kept running, beating a bad throw from Juan Lagares, then getting to his knees and thrusting his arms skyward in joy.

Adrian Gonzalez doubled him home, squibbing the ball inside the third-base line.

The Dodgers' energy is practically impossible to resist right now, coming at teams in waves. They did it again, wiping away a bunch of listless innings with a couple of magical ones to win their eighth straight game.

Since July 10, the Dodgers are 4-4 when trailing entering the ninth. Before that, they were 0-37.

"Here, nothing is impossible," Puig said in Spanish.

As dozens of reporters poured into the Dodgers' clubhouse, veteran utility man Jerry Hairston Jr. urged them to talk to the team's relievers. The bullpen once again shut down an opponent, pitching seven scoreless innings to set the stage for those late jolts of life.

The Dodgers have been taking their 70-and-up-year-old fans on a trip down memory lane with their hot play. They are the first team since the 1942 St. Louis Cardinals to win as many as 40 games in a 48-game stretch.

That was one of those great Cardinals team of the '40s, led by a 21-year-old Stan Musial. They beat the New York Yankees in five games in the World Series. The Dodgers already had the best seven-week stretch since the 1951 New York Giants, a team that broke the Dodgers' hearts and lost in the World Series to the Yanks. It was Willie Mays' rookie season.

So, in other words, these long hot streaks usually mean you're a pretty good ball club.

Not that the Dodgers looked particularly World Series-worthy in front of 44,091 fans for a large part of Wednesday, struggling against .500 pitcher Dillon Gee for most of the evening and falling behind early after a poor outing by Chris Capuano.

It certainly looks at times like the Dodgers can turn it on when they need to, overcoming several listless innings with a burst of excitement, but Mattingly isn't keen on that way of thinking.

"That's dangerous, because the next thing you know, you've lost three in a row," Mattingly said.

Gonzalez is having a nice season as the Dodgers' primary run producer, but for most of Wednesday, he was like a champagne cork in their offense -- the kind that never pops. The lumbering first baseman couldn't score from second with two outs on Skip Schumaker's single to left. The Dodgers left the bases loaded that inning despite picking up four hits.

In the sixth, Gonzalez couldn't score from first after Hanley Ramirez sent a screaming line drive all the way to the wall in left-center.

"Hanley looking at Gonzalez like, 'Isn't it a shame? So old you can't score on that!'" legendary broadcaster Vin Scully said on the telecast.

The Dodgers did score off Gee in that inning, with Mark Ellis narrowly beating out a double play to drive in one run and Hairston singling up the middle to make it 4-2.

One area of the roster that bears watching in the coming weeks is the back of the pitching rotation. The Dodgers might get involved in trading for a well-paid veteran who could clear waivers between now and Aug. 31 -- they made two trades after the non-waiver deadline last year -- or they could reach to Triple-A for a replacement for Capuano, who has been wildly inconsistent.

Capuano was not effective Wednesday. The Dodgers were in a 1-0 hole -- and Capuano had already allowed four hits -- by the time they batted in the second inning. By the time they hit in the third, they were losing 4-0.

Capuano (4-7) allowed 10 hits in five innings. In four of his previous seven starts, he had allowed exactly five earned runs. In the other three, he allowed exactly none.

The Dodgers could simply ride it out with Capuano. After all, should they reach the postseason, they'll likely need only four starters, and the primary alternative, Stephen Fife, has not been effective in two outings at Triple-A Albuquerque since coming off the disabled list (9.00 ERA in four innings).