Updated

Pirates fans aren't used to watching relevant baseball in July. They've responded favorably to it.

Rookie Alex Presley had three of the Pirates' 14 hits and Pittsburgh moved three games over .500 this late in the season for the first time in 12 years with a 5-3 win over the Houston Astros on Monday.

Chase d'Arnaud, Garrett Jones, Neil Walker and Lyle Overbay each had two hits for Pittsburgh, which played in front of its fourth consecutive home sellout crowd — another sign of how rare it is for the Pirates to be in contention.

Paul Maholm (5-9) allowed one earned run in six innings for the Pirates, who entered the day 1½ games behind Milwaukee and St. Louis the National League Central — the first time they were less than two games from a division lead this late in a season since 1997.

"It's fun, but we need to continue to play well," Maholm said. "In September, it will be a lot more fun. For any of us who have been here, it's uncharted waters, but you're seeing a group that's having fun and likes playing in front of big crowds. Today was cool. These were all Pirates' fans and you had 10,000 military personnel here, too. It was really a special day."

Jeff Keppinger had two hits and scored two runs and Hunter Pence went 2 for 3 to extend his hitting streak to nine games for the Astros, who have lost four consecutive, nine of 10 and 12 of 14.

They have the majors' worst record — a distinction that last season belonged to the Pirates. But Pittsburgh is 14 games better than it was at this point of 2010. The Pirates have won three of four and nine of 13.

"The energy and attitude is completely different," said Presley, who was recalled six days earlier after having played in 19 September games for Pittsburgh last season.

"We had already been eliminated when I got called up. Now, we're a game out of first place and we feel like we're going to win every time out. It's fun and just totally different. We had a good crowd and I really got to see what Pittsburgh fans are like this time."

Pittsburgh scored more runs Monday than it had in all but two of the previous 17 starts by Maholm, who allowed five hits and three walks with three strikeouts. Maholm has won four of his past six decisions, lowering his ERA to 3.08.

Daniel McCutchen, Jose Veras and Joel Hanrahan each followed with a scoreless inning of relief. Named an All-Star on Sunday, Hanrahan worked a perfect ninth to improve to 25 for 25 in save opportunities, a Pirates record for most consecutive saves without a blown save. It also tied the team mark for most saves prior to the All-star break.

With the game tied at 3 in the fifth, Walker singled to right, scoring d'Arnaud. Presley's two-out triple in the sixth scored Brandon Wood to make it 5-3.

Those runs came after the Pirates had rallied to tie Houston twice after trailing 1-0 and 3-1.

"A lot of things went on in the first three innings," Pirates manager Clint Hurdle said, "but we were able to slow things down and Paul was able to settle down.

"Defensively, we patched things up. We swung the bats consistently again," Hurdle added. "(Brett) Myers throws everything at you. For us to stay after it to catch up and go ahead showed a lot of moxie on our part."

Houston's two-run third came the result of three Pittsburgh errors, but the Pirates tied it the following half-inning when d'Arnaud doubled and scored on Andrew McCutchen's double. Overbay then drove McCutchen in with a single.

Myers (3-8) allowed five runs — four earned — with no walks and one strikeout in six innings.

"Balls were hit on the ground; they were right to the holes," Myers said. "I guess that's the way it's going. I felt like I made good pitches and they were just finding holes and making me work deep into counts."

A day after matching a season high for hits with 16 hits, the Pirates had 13 off Myers — the most he's allowed in 234 career starters.

"He didn't walk anybody, but they seemed to put the ball in play on him and kept fouling him off and fouling him off and kept getting the pitch count up," Astros manager Brad Mills said. "But he battled all the way through and gave us those six innings, and gave us that chance."

NOTES: Before the game, Hurdle criticized those involved with the selection process for next week's All-Star game for not including McCutchen. "I think everybody whiffed on this one," Hurdle said. McCutchen's .904 on base-plus-slugging percentage ranked fifth among NL outfielders heading into Monday. ... Pirates 3B Josh Harrison left the game after the third inning due to dizziness. He had collided with Astros C Carlos Corporan at home plate in the second. Harrison was being administered post-concussion tests Monday. ... The crowd of 36,942 ensured the first time the Pirates sold out four consecutive games in the history of 11-year-old PNC Park.