SAN DIEGO -- Up until the final swing he took on Tuesday, Chase Headley was having a rough night of sorts against the Pirates at Petco Park.When he came to the plate in the 10th inning with a runner on second base, Headley was 1-for-5 and still reeling over striking out with the bases loaded and no outs in the sixth. "It was a tough evening," Headley admitted. But his last swing not only made up for what rated as one of just a few subpar nights for the Padres third baseman this season, but it proved to be the game-winner, as his two-run home run gave San Diego a 7-5 victory over the Pirates in 10 innings before a crowd of 21,882. "That was fun," Headley admitted after. Headley's home run came off Pirates reliever Daniel McCutchen (0-1), who walked Will Venable to start the inning. Venable then stole second base and the Pirates (67-56) opted to go after Headley with first base open. Headley jumped on a cutter from McCutchen and sent a towering fly ball to deep right field that cleared the aisle, a home run that traveled 426 feet. That hit capped a wild and frustrating night for both teams, as the Padres (55-70) and Pirates went a combined 5-for-29 with runners in scoring position -- including a 4-for-19 mark by the Padres. "I came up all day with guys on base and couldn't come through," said Headley, who had two of the 16 hits in the game. Teammates Will Venable and Cameron Maybin each had four hits. San Diego pinch-hitter Chris Denorfia's sacrifice fly in the seventh inning gave the Padres a 4-3 lead and Carlos Quentin added a sacrifice fly in the eighth to make it 5-3. But interim closer Dale Thayer, filling in for an injured Huston Street, allowed a two-run home run with two outs in the ninth inning to Garrett Jones, his second home run of the game. San Diego starting pitcher Jason Marquis allowed three runs (two earned) on seven hits over 5 1/3 innings. He walked three, hit a batter and struck out five. The Padres took a 2-0 lead in the first inning as Quentin lined an opposite-field double into right field, scoring Venable and Headley. The Pirates countered with a run in the third inning and then took a 3-2 lead with two runs in the sixth, one coming on Jones' first home run. The Padres then tied the game at 3 in the bottom of the sixth when Cameron Maybin raced home on an error by Jones at first base on a ground ball hit by Venable. Pittsburgh pitcher A.J. Burnett allowed four runs on 12 hits and five walks with seven strikeouts in 6 1/3 innings. "He's a 35-year-old veteran pitcher. He's not going to melt," said Padres manager Bud Black of Burnett. "He kept throwing the breaking ball. He made pitches when he had to. He leaned on the breaking ball a bit." Burnett had plenty of praise for the Padres, who had a lot of good things to say about him as well -- like when he froze Headley with a breaking ball on a full-count pitch with no outs and the bases loaded in that sixth inning. "They hit a lot of balls in holes, just out of reach of guys -- they're a pesky team. You can't take anything for granted. They came out swinging, and placed the ball in good positions," Burnett said. Maybin and Venable each had a career-high four hits. Maybin has 10 hits in his past three games, while Venable has nine and leadoff hitter Everth Cabrera has eight. "They're getting their knocks. ... It's great," Black said. "Their swings are shorter and on a direct path to the ball." Miles Mikolas (2-1), the fifth reliever Black used, picked up the victory. He struck out two in one inning. In the end, the Padres were able to do the one thing they struggled to do all night -- get a big hit when it counted, as Headley's home run, his 21st of the season, gave the team its 17 victory in its past 20 games against the Pirates. "We had guys on base all night and didn't get the big hit until the end," Black said.