SAN DIEGO -- There is a theory of baseball that argues the longer a game goes in terms of innings and time, the wider the margin between the reward of winning and the cost of losing.
"Today is something that can really propel us," said Dodgers manager Dave Roberts after Yasiel Puig's two-run tiebreaking single in the top of the 17th inning keyed a 9-5 win that snapped a four-game losing streak and prevented the Padres from sweeping the series with three straight walk-off wins.
"We needed a win today without a doubt," Roberts said. "This is really special. It really is."
"You're going to carry a little baggage forward from a game like today," Padres manager Andy Green said.
Kendrick opened the 17th with a long ground-rule double to right-center and Gonzalez was intentionally walked. They advanced on a groundout by Ross Stripling.
Puig's big hit occurred eight innings after he made a baserunning gaffe in the ninth. He began the ninth with a single and took second on a wild pitch by Fernando Rodney.
"The infield was in so I had to put the ball in play," Puig said through an interpreter. "I had to do something to help my team after the baserunning I did when I didn't run when A.J. Ellis bunted. I was able to make up for it.
Puig never ran to third when A.J. Ellis placed a perfect bunt down the third base line, forcing third baseman Yangervis Solarte to field the ball with no one covering third. Puig also nearly was doubled up when left field Melvin Upton Jr. snuck in behind him.
"I got confused," Puig said. "I just didn't run, that's it."
"That was a play Puig would like to take back," Roberts said. "For him to get another opportunity seven or eight innings later and break it open was huge for him as well as us."
The Dodgers added two more runs on a wild pitch by Perdomo and a RBI ground-out by Carl Crawford.
Perdomo pitched a career-high five innings and allowed eight hits.
"What I hate most about today is what happened to Perdomo," said Green. "He deserved a better fate. He did a great job and I'm really proud of what he did. Out of everything, I hate what happened to Perdomo more than anything."
Stripling worked the final three innings, (2-3) was credited with the win. He was the ninth pitcher employed by the Dodgers and allowed two hits.
Both teams missed opportunities to score in extra innings.
The Dodgers had bases loaded and no one out in the top of the 14th and failed to score against Perdomo.
Joc Pederson and Puig opened the inning with back-to-back singles to put runners at the corners. Ellis was intentionally walked and the Padres brought the infield in but Crawford hit into a second to home to first double play and Chase Utley struck out with runners at second and third.
The Padres botched a golden opportunity in the bottom of the 11th. Solarte drew a four-pitch walk from left-handed Dodgers reliever Adam Liberatore to open the inning and Upton reached on an infield single while Solarte took third on a throwing error by Kendrick at first base.
Upton, however, was out trying to get back into first after rounding the bag for the first out. Following an intentional walk Alexei Ramirez, Christian Bethancourt struck out and Alexi Amarista lined out.
The Padres tied the game at 5-5 in the bottom of the eighth when Upton handed Dodgers closer Kenley Jansen his second blown save in as many outings after the right-hander had converted 25 straight saves.
Two days after hitting a two-run walk-off homer off Jansen, Upton had a two-out triple that scored Wil Myers.
Myers helped the Padres take a 4-0 lead by hitting a bases-loaded triple in the fifth on a ball that skipped past Puig in right field.
Before Upton's game-tying triple, the Dodgers rallied from the four-run deficit to tie the game in the seventh on a solo homer by pinch-hitter Justin Turner off left-hander Ryan Buchter. Los Angeles took a 5-4 lead an inning later on a solo homer by Kendrick off Brandon Mauer.
The game was scoreless and the Padres were hitless through four innings innings when San Diego scored four runs in the bottom of the fifth against right-handed Dodgers starter Kenta Maeda.
NOTES: Sunday's game was delayed 15 minutes in the top of the fifth after home plate umpire David Rackley was injured by a foul tip off the bat of the Dodgers' Joc Pederson. Rackley had to leave the game with Alfonso Marquez taking over behind the plate in a three-man crew . . . Dodgers C Yasmani Grandal came out of Saturday night's game after fouling a ball off his right foot. Grandal didn't start Sunday though X-rays were negative . . . After two rehab starts with Single-A Rancho Cucamonga, Dodgers LHP Hyun-jin Ryu is moving up to Triple-A Oklahoma City. Ryu is on the 60-day disabled list following shoulder surgery. ... Padres LHP Matt Thornton (left Achilles tendinitis) allowed an unearned run in an inning Saturday night in his rehab debut with Single-A Lake Elsinore.