SAN DIEGO -- With another sub-par showing from their top-ranked pitching staff, the San Diego Padres' offense picked up the slack again.
The offensive showing continued a recent tear that has San Diego's offense supporting its normally reliable pitching staff.
"Even though we would like to see them continue at the pace they had in the first half, it's sort of not realistic to think you can do that all season," Gwynn said. "They carried us in the first half and now we're trying to take the load off their shoulders."
The Padres, who rank near the bottom in the NL in runs and homers, have certainly done that over the last eight games. During that stretch, San Diego has hit 15 long balls while batting .315 and averaging just more than seven runs.
"In the first half of the season, most of the guys were not able to make adjustments," Torrealba said. "We still have the same guys, but we have started to take advantage of pitcher's mistakes. We are 100 percent better."
Torrealba's two-run shot gave the NL West leaders a 4-3 lead in the third inning. All-Star slugger Adrian Gonzalez broke a 4-all tie with his 20th home run in the fifth, a solo shot.
Torrealba also had RBI singles in the first and seventh as San Diego beat the Diamondbacks for the sixth time in eight games this season, including five straight at home.
"I do think we can do some things offensively that we didn't do in the first half," Padres manager Bud Black said.
The offensive outburst has come at a good time for San Diego, which has won three straight. The pitching staff, which has the majors' lowest ERA, has given up an average of more than five runs per game over the last eight games.
"The pitchers don't feel that much pressure when we score like this," Torrealba said. "I think it changes their thinking a bit because they don't have to be perfect."
Gonzalez became the third Padres player to reach the 20-homer mark five times. Hall of Famer Dave Winfield and all-time club leader Nate Colbert are the other two, but Gonzalez and Colbert (1969-73) achieved it in consecutive seasons.
Gonzalez then homered to center off Lopez in the fifth to put the Padres ahead to stay. One inning later, Gwynn hit a slicing ball down the left-field line that got by a diving Rusty Ryal and rolled all the way into the corner.
The speedy Gwynn slid home ahead of the relay throw by Kelly Johnson for his second inside-the-park homer this year, tying the club's single-season mark set by Gene Richards in 1982.
"As soon as he left his feet, I didn't think he had a chance to catch it," Gwynn said. "When it rolled to the wall, I knew I had a chance."
The last major leaguer to have two inside-the-park homers in the same season was Kansas City's Mark Teahen in 2008, according to research by the Elias Sports Bureau.
Lopez, who allowed six runs and six hits over six innings, tied his career high for homers allowed and took over the major league lead with 23.
"It was a big disappointment for me coming after [Friday night's] game," Lopez said. "I made some bad mistakes on pitches. I battled, but I'm not very happy with the results."
Torrealba hit his two-run drive in the third after Hairston Jr. led off with his seventh home run. Torrealba's homer was his second and gave San Diego a 4-3 lead.
Adam LaRoche had a two-run single for the last-place Diamondbacks, who dropped a season-high 19 1/2 games behind San Diego with their ninth loss in 11 games.
Richard got the win despite another shaky outing. He gave up five runs and nine hits, which tied his season high. The left-hander did not get a decision in his previous two starts despite allowing a combined 11 earned runs.
Gwynn matched the number of career inside-the-park homers by his father, Hall of Famer Tony Gwynn. ... Padres first base coach Rick Renteria was ejected in the third inning by first base umpire Kerwin Danley. Scott Hairston was the runner at first when Lopez made a pickoff throw. Renteria and Danley began exchanging words and a few seconds later, Danley ejected Renteria. ... Lopez has allowed four homers in a game three times. ... The 11-game hitting streak for San Diego's Aaron Cunningham was snapped when he went hitless in four at-bats.