PITTSBURGH -- Jeff Locke wasn't dominant but he was good enough to win and make some history, too, Wednesday night.
The left-hander set a Pirates record for most consecutive starts in a single season without a loss, pitching National League Central-leading Pittsburgh to a 6-5 victory over the Philadelphia Phillies at PNC Park.
Locke (8-1) has gone 16 starts since suffering his lone defeat of the season April 7 against the Dodgers at Los Angeles. The record was set by Dock Ellis in 1971.
Locke, in his first full major-league season, also has the longest active winning streak in the NL with his eight victories in a row. That is the longest streak by a Pirates lefty since John Candelaria won eight straight in 1983.
"We have something special going on here right now and every starter just wants to continue it and give it to the bullpen and put ourselves in position to win," Locke said.
Locke gave up three runs (two earned) and seven hits in 5 2/3 innings Wednesday. He walked three and struck out two.
"He's gaining experience every time he goes out there," Pirates manager Clint Hurdle said. "He's been, for me, more proactive in what he's doing than reactive. He's just staying with his game plan, he's getting his pitches off in good rhythm and pace.
"He's got a very good demeanor. There seems to be no panic, no urgency, just continue to make pitches and focus on that pitch to that hitter."
Jason Grilli recorded his 28th save in 29 opportunities, but it wasn't without a scare.
Domonic Brown hit a two-run home run deep into the right-field stands with two outs in the ninth inning, his team-best 22nd, to draw the Phillies within 6-5. However, Grilli then struck out Delmon Young to end the game.
Brown, though, took little consolation from the home run or the idea it might help brandish his credentials for the All-Star Game. The rosters will be announced Saturday for the game, which will be played July 16 at New York.
"I'd like to make the All-Star team. It'd be a great honor," Brown said. "I'm not really thinking about that right now. I'm thinking about our team and how we can start winning some games. The All-Star Game would be nice but the big thing is to get things turned around here."
The Pirates won for the 10th time in 11 games and improved their best-in-the-majors record to 52-31.
Philadelphia's John Lannan (1-3) allowed four runs and 11 hits in five innings. He walked three walks and struck out five while falling to 1-5 in 10 career starts against the Pirates.
"It definitely wasn't one of his better games, Philadelphia manager Charlie Manuel said. "At the same time, he was trying to battle and keep us in the game. He was just in trouble most of the game.
Pedro Alvarez hit a tiebreaking three-run home run in the fifth inning off Lannan, his team-leading 21st of the season, to put Pittsburgh ahead for good, 4-1.
It was just the third home run the left-handed hitting Alvarez hit off a left-handed pitcher in 70 plate appearances this season.
"Obviously it's a work in progress and it's one of those things where you can only improve with opportunities and experience," Alvarez said of hitting lefties. "You've just got to try to learn from each instance and that's what I intend on doing. I feel very confident in myself to keep progressing and keep learning."
Andrew McCutchen went 3-for-3 and raised his batting average at PNC Park this season to .356 (55-for-163). Russell Martin added two hits and two RBIs, and Starling Marte extended his hitting streak to eight games.
Young continued a big road trip with three hits, including the 1,000th of his career when he singled in the fourth inning off Locke. Young is 15-for-30 (.500) in the first nine games of the 10-game trip that ends Thursday when the Phillies, after splitting the first two games, will try to win their first series in Pittsburgh since 2008.
Brown also had three hits.
After Alvarez put the Pirates ahead, the Phillies (40-45) closed to 4-3 by scoring two runs and chasing Locke in the sixth inning. Pinch hitter Kevin Frandsen hit an RBI single, and the second run scored on shortstop Jordy Mercer's error.
The Pirates restored the three-run cushion in the bottom of the sixth when McCutchen tripled and scored on a double by Martin. The other run came home on a wild pitch by Jake Diekman, who struck out all five batters he faced.
NOTES: The Pirates activated OF Jose Tabata from the 15-day disabled list before the game and optioned RHP Brandon Cumpton to Triple-A Indianapolis. Hurdle said Tabata would be given a chance to win the right field job outright after platooning with OF Travis Snider prior to going on the DL on May 25. Hurdle then double-switched Tabata out of the game for Snider in the seventh inning. ... Pittsburgh RHP A.J. Burnett (strained right calf) believes he is ready to come off the disabled list and pitch this weekend against the Cubs in Chicago after getting through a three-inning simulated game Tuesday without difficulty. ... Phillies 1B Ryan Howard was not in the starting lineup against the lefty, and John Mayberry Jr. started in his place. Howard pinch-hit in the seventh inning and struck out against RHP Jeanmar Gomez. Howard has just a .509 OPS against lefties this season and also felt left knee soreness after Tuesday's game. ... Philadelphia LHP Cole Hamels (2-11 4.58) faces RHP Gerrit Cole (4-0, 3.70) on Thursday.