LOS ANGELES — Don Mattingly’s first two postseasons as a manager were not a total loss. “Every day you learn,” Mattingly said this week as his Los Angeles Dodgers prepared for their National League division series against the Mets.

In last year’s N.L.D.S. opener at Dodger Stadium, Mattingly waited one batter too many before yanking his wilting starter, Clayton Kershaw, who gave up a go-ahead three-run double to the Cardinals’ Matt Carpenter in the seventh inning of a game that St. Louis held on to win.

So on Friday, after a wilting Kershaw walked Lucas Duda on five pitches to open the seventh and also issued free bases to two of the next four batters, Ruben Tejada and Curtis Granderson, by letting them wiggle free from 1-2 counts, Mattingly made his move.

With the Dodgers trailing by 1-0, Mattingly brought in a right-handed reliever, Pedro Baez, to face David Wright, who came through with a two-run single that proved to be the difference in the Mets’ 3-1 victory in front of a sellout crowd at Dodger Stadium.

The loss belonged to Kershaw, who was charged with three runs and allowed four hits and four walks, with 11 strikeouts, in six and two-thirds innings.

“I got outpitched,” Kershaw said, acknowledging the effort of Jacob deGrom, who allowed five hits over seven innings and struck out 13 to earn the win.

But Mattingly’s performance was the one placed under the magnifying glass as Dodgers fans, in what has become a rite of fall, second-guessed his decision-making. On Twitter, some were calling for his firing even after an R.B.I. single by Adrian Gonzalez in the eighth gave the Dodgers hope. With two outs, Justin Turner, who represented the tying run, lined out to end the inning.

Mattingly explained the method behind his move. He noted that Kershaw had thrown 25 pitches in the seventh inning to bring his count to 113 and, had he remained in the game, would have faced Wright, who hit .351 against left-handers in the regular season.

“We felt David’s numbers against lefties were really good,” Mattingly said. And Kershaw, he added, “was just out of sync a little bit.”

Daniel Murphy broke a scoreless tie in the fourth when he deposited a 2-0 fastball from Kershaw into the right-field stands. “Obviously Murphy put a good stroke on the ball,” said Kershaw, who rued his 3-2 pitches to Tejada and Granderson in the pivotal seventh.

“That pitch to Tejada, I really wanted to have that one back,” he said. “The other one to Granderson, just kind of a good battle.”

Kershaw added, “Obviously, you can’t walk that many guys.”

Asked how badly he wanted to finish the seventh inning, Kershaw shrugged. “I put myself in that spot,” he said, “so not so much room for arguing.”

Kershaw may not have gotten the job done late, but the Dodgers’ hitters, by not getting to deGrom early, put Mattingly in the fans’ cross hairs.

Referring to deGrom, Mattingly said, “I thought we did a pretty good job of not chasing the changeup or breaking ball down, but with that, you end up chasing some elevated fastballs, and he ended up beating us with that.”