It was just 5 1/2 weeks ago when the Pittsburgh Pirates were under .500 and facing a large deficit in the NL Central.
Not long before that, the San Francisco Giants had a seemingly comfortable lead in the West.
The races look much different now as the surging Pirates look to complete a three-game road sweep by handing the Giants a seventh straight defeat Wednesday afternoon.
Pittsburgh was 35-38 and nine games behind first-place Milwaukee on June 20, part of a disappointing start to 2014 for a club that ended a 20-year playoff drought last season.
The Pirates (57-49) have gone 22-11 since and are on the verge matching their longest winning streak of the season after beating San Francisco 3-1 on Tuesday for their third consecutive victory.
Josh Harrison homered leading off the game and Travis Snider added a two-run shot in the second inning for Pittsburgh, which took a one-half game edge over St. Louis for the NL's second wild-card spot and climbed to within one game of the Brewers for the Central lead.
The Pirates have taken the first two of this series from a San Francisco club that has been outscored 27-6 during a six-game losing streak that matches its longest of the season. The Giants (57-50) were swept in a three-game set with the Dodgers over the weekend and are now three games back of Los Angeles in the West.
Buster Posey had three hits Tuesday after going 2 for 17 over his previous six for the Giants, who led the Dodgers by as many as 7 1/2 games on June 13.
"We have to find a way," manager Bruce Bochy said. "It's tough to go through this.''
San Francisco looks to end its skid behind Tim Lincecum, who hasn't had much success against the Pirates recently.
Lincecum (9-7, 3.96 ERA) went 4-1 with a 0.96 ERA over his previous five starts beginning with his no-hitter against San Diego on June 25, then was roughed up for six runs and nine hits in 4 1-3 innings of an 8-1 loss to Los Angeles on Friday.
The right-hander allowed four runs during his hot stretch.
''I got away from my plan. I didn't throw as many breaking balls and sliders as I wanted to,'' Lincecum said. ''I think those have been kind of the equalizer for me in keeping guys honest.''
Lincecum didn't have his best stuff against Pittsburgh on May 7 either, allowing four runs and eight hits in four innings of a 4-3 loss. He's pitched fewer than five innings in three of his last four starts against the Pirates, going 1-3 with a 7.79 ERA in that stretch.
Pittsburgh will counter with Charlie Morton, who seeks a similar outing to his first against the Giants this season.
Morton (5-10, 3.40) was rolling along through six innings Friday against Colorado, but he allowed the first three hitters to reach in the seventh and was charged with three of his four runs allowed without recording an out in that inning while taking an 8-1 loss.
The right-hander went 1-1 with a 2.73 ERA in his previous five starts.
"I thought it was good pitching from me (Friday)," Morton said. "In the seventh, that's when it got away."
Morton pitched a gem against the Giants on May 6, allowing an unearned run and three hits in eight innings before Starling Marte tripled and scored on an error in the bottom of the ninth for a 2-1 win. Morton is 2-1 with a 1.60 ERA in his last five starts against San Francisco.
Marte is eligible to come off the seven-day concussion list Wednesday, but he hasn't yet been cleared to play.