Will Venable gave the Padres the lead with his bat and almost gave it back with his glove.
Then, he made closer Heath Bell's job tougher in the ninth when he misplayed a flyball for an error, helping the Astros load the bases.
"All is well that ends well," Venable said.
Bell got his 38th consecutive save the hard way. He loaded the bases with one out in the ninth and then got the last two batters on a strikeout and groundout.
"I thought Will had that ball," Bell said. "I had to pick Will up at that point."
The Padres salvaged a split in the four-game series. Houston hasn't won a series over San Diego since June 29-July 2, 2009, and the Padres haven't lost a series in Houston since 2005.
Trailing 6-4 at the start of the eighth, the Padres got a run on Jason Bartlett's one-out RBI single. Pinch-hitter Brad Hawpe walked to load the bases then Venable singled to right field for the go-ahead hit off Mark Melancon (1-1).
"Will got on the high fast ball and lined it out to center," Padres manager Bud Black said. "That was a big hit. We had some good at-bats all through that (eighth inning). We didn't extend the zone, we swung and strikes and took balls."
Ernesto Friero (1-1) pitched 1 2-3 innings for the victory. He struck out three and allowed one hit.
Jason Michaels singled off Bell to start the Astros ninth. Chris Johnson struck out and Brett Wallace walked. Humberto Quintero hit a long fly to Venable, the right fielder, who missed the ball for an error loading the bases. Matt Downs struck out of a full count and Jason Bourgeois grounded out to end the game.
"I don't know what it is, maybe we were playing a big uphill battle," Bell said. "We weren't getting that big hit. We've got to fight and scratch and claw for every win right now. Maybe I've got to do that, too."
Venable took credit for the dramatic ninth inning.
"I have no excuses," Venable said. "I will say the lights made it tougher on me than it needed to be but that's a play you have to make."
Brett Myers extended his string of pitching at least six innings to 36 of his last 37 starts. He allowed a solo homer to Nick Hundley in the second and a two-run shot to Cantu in the fifth. Myers struck out four and walked two.
"I try to leave everything on the field when I go out there," Myers said. "I don't try to back down from anything, even if I'm not feeling as good as I think I should feel that day. I'm still going to go out there and battle and give us a chance to win."
San Diego's Clayton Richard pitched 5 1-3 innings, and allowed seven hits, walked one and struck out five.
"I could tell my stuff wasn't as good as it's been in the past," Richard said. "We were faced with a tough situation later in the game but the bats pulled through and of course the bullpen did a tremendous job."
Hundley led off the second inning with a first-pitch home run, his third of the season. Myers then struck out Ryan Ludwick and Cameron Maybin tripled over center fielder Bourgeois' head.
Maybin was caught in a rundown on a grounder by Bartlett and Myers struck out Richard to keep it a one-run game.
Bill Hall, hitless in his previous 10 at-bats, gave the Astros the lead with a two-run single in the second. Michaels walked and Johnson doubled before Hall singled down the first base line. He was caught trying to take second.
Houston got two more runs in the third on an RBI double by Hunter Pence and Carlos Lee's RBI single.
Cantu's two-run homer in the fifth continued his success against Myers. Cantu is hitting .450 for his career against Myers.
"We've played so well defensively so far," Astros manager Brad Mills said. "I think going into yesterday we were the top team defensively — and so to see that fall apart. That's something we haven't been doing. That was tough."
NOTES: Hudson's 11-game hitting streak ended Saturday night but he still has reached base in all 15 games this season. He was 0 for 3 Saturday with a walk. He is 6 for 6 on stolen bases this season. ... Brad Hawpe has the second best batting average against Houston among active players (50 for 145, .345.)