Ellis, meanwhile, has been back from leg surgery only a little more than a week, but the home run was a reminder that Kemp and Ethier weren't the only injured Dodgers that were missed.
"To get all three back -- Mark, Matt and Andre -- mentally it gives us a lift," Mattingly said. "It changes the order and allows us to play guys where they should be. It spreads the lineup. This is a nice start to the second half."
The homer that ruined Clayton Richard's shutout came two batters after Kershaw was lifted for a pinch-hitter, having thrown another quality start but in line for another tough loss. Tony Gwynn, batting for Kershaw, bunted for a single, which was followed one out later by Ellis' homer.
"I got it good, a hanging curveball or slider, I'm sure a pitch he'd like have back," Ellis said. "It's real fun to get a big hit in my first game back at Dodger Stadium."
And Ellis didn't deny that he gets better pitches to hit with the impact bats of Kemp and Ethier behind him.
"Obviously, they don't want Matt to come up with people on, so I'm likely to get fastballs, good pitches to hit," he said.
Kemp, who missed nearly two months with a strained left hamstring, had a double, single, groundout, flyout and never really accelerated on the bases or in the field.
"I felt good at the plate," said Kemp, who admitted he was more nervous than normal. "It's just good to get out there and get something going and it kind of made it easier getting my first hit. After that, my nerves kind of just calmed down."
Ethier, who missed two weeks with a strained oblique muscle, grounded out, grounded into a double play and was hit by a pitch.
Kershaw's departure required scoreless innings from Javy Guerra, Ronald Belisario and Kenley Jansen.
Guerra, who returned from knee surgery a week ago, pitched with the knowledge that he'd be leaving for Mexico on Saturday to be in Nuevo Laredo with his father, who suffered a heart attack.
Belisario had just returned from a difficult trip to Venezuela during the break, detained by Immigration and Customs Enforcement in Miami and missing Thursday night's workout.
Jansen picked up his 16th save and has pitched nine consecutive hitless innings, despite continued erratic velocity. The Dodgers, who had lost 15 of the previous 20, clung to their half-game lead over the Giants in the National League West. They are 8-2 against San Diego this year.
"One pitch, one big pitch and a big hit," Padres manager Bud Black said of Ellis' home run.
San Diego scored in the second inning. Yasmani Grandal blooped a hit that fell in front of Kemp, who tried to backhand the ball on a bounce and accidentally kicked it toward the infield with his shin and Grandal had a double.
Kershaw then lost a 10-pitch battle with Yonder Alonso for a walk. On Cameron Maybin's comebacker, Kershaw looked to second before settling for the out at first. Everth Cabrera followed with a groundout that scored Grandal.
Kershaw pitched out of trouble that inning, and the third, fourth and fifth as well. He finished with six strikeouts, three walks and 110 pitches three days after a 27-pitch inning in the All-Star Game.
"It was a battle," said Kershaw, who had a sharp-breaking curveball but is not fooling hitters with the slider as he did a year ago. "I threw a lot of pitches and only could make it through six and you never want to just go six innings, but Mark had a huge hit and our bullpen shut it down. It was a good team win tonight.
"It feels good just to get our lineup we expect to have out there every day back out there. It's a confidence booster for the team, getting guys back. There's no excuses now, just start winning games."