The Pirates benefited from the loss to pull within 1 1/2 games of the Cardinals, who haven't had a division lead that tenuous since the first day of September. With their magic number at four, the earliest St. Louis can clinch a second straight division title is now Friday.
"Obviously, Pittsburgh is playing well right now," said starter Shelby Miller, whose 4 1/3-inning start was his shortest since June. "No doubt, that team is not going to give up. But then again, neither are we. We know what we're capable of and will take it day by day and try to win each game."
Neshek pushed the game into extras with a clean 13-pitch ninth inning that manager Mike Matheny later said made it an easy decision to send him back out for the 10th. Though he hadn't made a multiple-inning appearance since Aug. 10, Neshek was pitching on four days' rest.
Anthony Rizzo blasted a one-out double off the wall in center. A groundout and intentional walk then brought up Castillo, who drove a pitch too far for center fielder Peter Bourjos to catch up to.
"I was aggressive, looking for something over home plate that I can drive, and he threw me a slider over home plate and I was on it," Castillo said. "I was on top of that, and I was lucky to hit it."
Castillo drove in three runs, the first two via a second-inning homer off Miller that was set up by Miller's first walk in 20 innings. The Cubs built their lead to three when Matt Szczur deposited an over-the-plate fastball into the stands in the fifth. Both costly pitches were four-seam fastballs, which Miller threw a heavy dose of after a string of starts in which he relied more heavily on his sinker and curveball.
The swing-happy Cubs brought about the change in approach, Miller said, and he did benefit by riding the pitch to a season-high eight strikeouts. But those were overshadowed by the mistakes.
"To his credit, it was working at the beginning," Matheny said of the approach. "But that's also a dangerous way to pitch, as we saw."
Tyler Lyons helped close the fifth inning for Miller. Whether Miller will pitch again in the regular season will depend upon whether the Cardinals alter their rotation schedule to have him make a postseason tuneup on Sunday.
That is, of course, if he fits prominently into the team's postseason plans. Last year, Miller spent October watching from the bullpen bench. This year, he made his case for inclusion in the playoff rotation by finishing the season with a 1.48 ERA over five September starts.
"This stretch I've been on, I feel good," Miller said. "I feel like, besides tonight, I've been throwing the ball pretty well. Tonight was weird. I felt good. I just made a couple bad pitches, that's it."
The Cardinals took him off the hook for a loss by evening the game with a three-run sixth that opened with singles by Oscar Taveras and Matt Carpenter. After an RBI groundout from Jon Jay, Holliday appeared as the potential tying run.
Cubs starter Kyle Hendricks buzzed Holliday's face with his second pitch, then slumped his shoulders as he watched Holliday pulverize a 2-2 fastball over the left-field wall.
"I was trying to pitch around him," Hendricks said. "If I walk him, I walk him. I know that, that's my mindset, and we talked about that in the [pregame] meeting. I throw a sinker, it starts on the black and cuts. It didn't sink. I went back and watched it on video, and I still can't believe it ended up where it did."
The homer secured a ninth straight 20-homer season for Holliday and gave the Cardinals as many runs off Hendricks in that inning as they had scored in the previous 17 1/3 against him.
His next time up, Holliday opened the eighth with a double. Matt Adams couldn't move him to third, though a wild pitch did. Still, Jhonny Peralta and Yadier Molina couldn't get him home. It was the second time in the game that the Cardinals couldn't get a runner home from third with less than two outs.
"Those, in games like this, typically come back to haunt you," Matheny said. "And it did."