DENVER  Cameron Maybin twice used his legs to score what turned out to be the decisive run and Luke Gregerson picked up his third save in as many outings Friday night as the Padres scored a 5-4 win over the Rockies at Coors Field.

The victory was the Padres’ 10th in their past 11 games — moving them to less than 10 games under .500 for the first time since May 8.

Carlos Quentin homered and drove in two runs, Chase Headley closed out August with his 31st RBI and left-handed starter Clayton Richard allowed three runs on eight hits over 6 1/3 innings to even his season record at 12-12.

But the deciding factors Friday were Maybin’s speed and Gregerson’s ability to close out the game after seeing his scoreless inning streak end and a close call go against him.

“You can’t let setbacks get to you,” Gregerson explained after he picked up his third save in as many opportunities since his and Dale Thayer’s end-of-game roles were flip-flopped during the absence of closer Huston Street.

“I love it,” Gregerson said of his opportunity to close out wins. “It’s what every relief pitcher loves to do.”

But Gregerson might have been dealing with his first blown save had it not been for two pieces of daring baserunning by Maybin in the eighth. Maybin’s speed gave the Padres an insurance run that became the winning run.

In the same inning, Maybin had an infield double and scored from second on an infield single.

The Padres were leading 4-3 with one out in the eighth when Maybin hit a grounder to the right of Rockies second baseman DJ LeMahieu. Even had LeMahieu fielded the ball cleanly, Maybin was going to reach first with his 13th infield hit of the season (compared to 37 last year).

But the ball ticked off the edge of the second baseman’s glove and rolled toward the foul line — allowing Maybin to dash into second with an infield double.

The swift center fielder was just getting started, however.

With two out and Denorfia pinch-hitting, Maybin broke for third on a steal attempt. But Denorfia grounded the ball past relief pitcher Rex Brothers. Although Rockies shortstop Josh Rutledge’s diving stop prevented the ball from rolling into center, Maybin never broke stride and scored without a throw.

“I was running with my head up,” said Maybin. “On the grounder, I saw the ball roll away and saw the right field had a long run while the second baseman was on the ground so I made a quick decision to go.

“On the steal, I had third. But I picked up (third base coach Glenn) Hoffman letting me know to keep going and I peaked over my shoulder to see (Rutledge had a tough play).”

The run became critically important when Colorado’s Andrew Brown led off the ninth with a line drive homer into the left field seats off Gregerson — a shot that ended his career-best scoreless innings streak at 23.

“Hanging slider,” said Gregerson. “One of those pitches you wish you could reach out and grab before it’s hammered.”

Gregerson then struck out Tyler Colvin but saw a second Rockie reach base on a throwing error by shortstop Everth Cabrera. Gregerson got the last two outs on fly balls.

“That play at first didn’t bother Luke,” said Padres manager Bud Black. “The homer and that play gave Colorado a little bit of momentum. But he has poise. He knows his stuff. That Luke remained calm there did not surprise me.

Earlier, Quentin led off the second with his 15th homer of the season for the game’s first run and gave the Padres a 4-1 lead in the top of the fifth with a double that followed a Chase Headley double. In the third, Headley drove in his 31st run of August – equaling the second-highest total in franchise history for August.

The Padres finished 18-10 in August— tying the 1996 team for the best August in franchise history.