"That was a clutch performance by Woody," said Mike Cameron, who hit a two-run homer. "But that's what we've come to expect from him. He is a veteran guy who knows how to win."
After getting swept at home in a four-game series against San Francisco, the Padres pulled within three games of NL West-leading Los Angeles.
"It was big, no doubt about it," said Williams, who turns 40 on Saturday. "We had to do something positive. The guys came out to play today. The attitude and the environment were really good today. I think everyone realized that it couldn't get any worse than the last four days."
San Diego moved into a tie with Arizona for second place in the NL West, and both clubs also pulled within one game of Cincinnati, the NL wild-card leader. The Padres won for the third time in 11 games and are 13-21 since the All-Star break, when they led the division by two games.
"It's great to be resilient and bounce back after a tough series against the Giants," Padres manager Bruce Bochy said. "It's huge for the ballclub."
Conor Jackson had two hits for Arizona, including a two-out homer in the sixth.
Enrique Gonzalez (3-5) gave up five runs and six hits in 6 1/3 innings, dropping to 0-3 in six starts since beating Los Angeles on July 17. It was his longest outing since then.
"I left too many pitches up and missed the plate," Gonzalez said.
"He didn't have as good of command in the first as it was later," Arizona manager Bob Melvin said.
Blum started in place of Khalil Greene at shortstop. Green, who recently missed six games with a sprained middle finger on his left hand, is still bothered by the injury.
Cameron hit a homered off Brandon Medders to cap a three-run seventh inning that put San Diego ahead 6-1. Roberts had an RBI single in the inning.
Chris Young, making his major league debut for Arizona, singled in the eighth for his first major league hit and scored on a bloop single by Stephen Drew. Roberts added a two-run single in the eighth off Jorge Julio.
- The popular Bochy received rare boos when he took out Williams.
- Meredith, who got the final out of the eighth, has not allowed a run in his last 16 appearances and 18 innings.