Evan Longoria powered a home run off Max Scherzer through fierce wind. Chris Taylor and pinch-hitter Gavin Lux fell short, putting the defending World Series champions on the brink of elimination.

Longoria’s shot in the fifth inning held up, giving the Giants a 1-0 win over the Los Angeles Dodgers on a cold, blustery Monday night with conditions more akin to San Francisco. The Giants took a 2-1 lead in the NL Division Series.

“I don’t remember a lot of nights at Dodger Stadium where the wind was blowing like that,” said San Francisco manager Gabe Kapler, who grew up in Los Angeles. “Super strange.”

The gusty winds whipped the flags in center field and even caused Scherzer to stumble delivering an early pitch.

“The wind was really pushing me towards home plate,” said Scherzer, who lost a postseason game he started for the first time since Oct. 12, 2017, against the Chicago Cubs.

Los Angeles nearly tied it with two outs in the ninth, when Lux launched a long drive to left-center with an exit velocity of 107 mph and an estimated batting average of .890, according to Statcast. But the wind knocked it down and the ball was caught on the warning track, leaving Lux in disbelief.

“My stomach pretty much sank when he hit it. I couldn’t believe that it didn’t go,” Longoria said. “I guess it was our night.”

Taylor flied out to deep right-center with a runner on in the sixth.

“I think any other night the CT ball, the Gavin Lux ball, would have been home runs, yeah,” Dodgers manager Dave Roberts said.

It was the Giants’ second shutout in the best-of-five playoff after winning the opener 4-0.

Game 4 is Tuesday at Dodger Stadium and Game 5 would be in San Francisco on Thursday, if necessary.

The Dodgers routed their longtime rivals 9-2 to win Game 2, but mustered just five hits back at home. NL batting champion Trea Turner and Mookie Betts each went 0 for 4, and Corey Seager was 0 for 4 with a walk.

“I thought we took some good at-bats and we just didn’t get rewarded,” Roberts said.

Longoria broke out of an 0-for-23 slump in a big way with his leadoff shot on an 0-2 pitch to left-center. It was his first postseason homer since the 2013 ALDS with Tampa Bay.