Alonso hit the last of San Diego's three solo homers and added a two-run single to lead the streaking Padres past the Arizona Diamondbacks 9-3 on Saturday night.
"For a while it seemed like I was trying to guide the ball every time," Alonso said. "Then I realized you don't have to work so hard to do it, just get a good swing and maybe get a single or double."
Clayton Richard (11-12) allowed three runs and seven hits over eight innings, improving to 5-0 in seven career starts against Arizona. He struck out four and walked two.
Richard leads the National League with 184 innings pitched.
"That tells you a couple of things," Padres manager Bud Black said. "First, he's performing to where we're not taking him out. And his pitch count is such to allow him to stay in. He's not pitch-counting himself out."
Arizona is 4-9 in its last 13 home games after winning eight straight at home in July.
"They out-executed us in every aspect of the game," Diamondbacks manager Kirk Gibson said. "There you have it."
Kennedy (11-11) faded in the sixth and allowed six runs on four hits over 5 1-3 innings. He walked four, hit a batter with a pitch and struck out six.
Alonso's home run just over the right-field fence leading off the fifth put San Diego ahead 3-2, and the Padres quickly added to the lead.
Everth Cabrera walked to start the sixth and was sacrificed to second. Kennedy then walked Headley, hit Quentin in the middle of the back with a pitch and walked Yasmani Grandal to force home Alonso and make it 4-2.
Alonso followed with a sharp single to right, scoring Headley and Quentin for a 6-2 lead.
"Definitely, he was struggling," Alonso said. "He was trying to find the zone and I knew either I had to wait for my pitch or be more aggressive. He threw a pitch over the plate and I got good wood on it."
"They were putting pressure on us," Upton said. "It is pretty tough to win like that. They did a great job of standing on the gas pedal."
Hill homered in the bottom of the eighth for the Diamondbacks.
Headley homered just inside the right-field foul pole with two outs in the first to give the Padres a 1-0 lead.
After Paul Goldschmidt walked leading off the second, Upton lofted a pitch to right-centre and the ball hit just above the base of the wall and caromed wildly back toward straightaway centre. Upton was rounding third base before Cameron Maybin could run down the ball and slid safely across the plate with yards to spare to put the Diamondbacks up 2-1.
"I told him it was a birthday carom," Maybin said, smiling.
Quentin tied it with a home run onto the concourse overhanging the centre-field wall.
NOTES: Upton became the first player to hit an inside-the-park home run on his birthday since Hall of Famer Lou Brock for St. Louis in 1976 against the Padres. ... Quentin was hit by a pitch for the 16th time this season, setting a franchise record. ... Kennedy is tied with Dodgers RHP Joe Blanton for the NL lead with 26 home runs allowed. ... Diamondbacks C Miguel Montero threw out Cabrera trying to steal second in the third, the first such runner thrown out by an Arizona catcher since July 22. ... Upton's inside-the-park home run was the Diamondbacks' second this season and the ninth in franchise history. ... RHP Edinson Volquez (8-9) pitches Sunday for San Diego against Joe Saunders (6-10) in the series finale. Volquez permitted one run in his last start, snapping a streak of four straight with four or more runs allowed. Saunders is 1-4 with a 6.60 ERA in his last five starts.