SAN FRANCISCO — As pitch after pitch played out, the goblins of past heartbreak began to creep back. If tales of goats, a fan named Steve Bartman and past playoff collapses and curses began to be revisited, another very real specter appeared in the head of Joe Maddon, the manager of the Chicago Cubs.

It had dreadlocks, a barrel chest and a history of throwing darts at his team’s hitters. It was sitting in the home dugout on Tuesday night.

“Johnny Cueto was etched all over my frontal lobe,” Maddon said of the San Francisco Giants pitcher who was itching for another shot at the Cubs in a win-or-go-home game back at Wrigley Field. “And I didn’t like it.”

There was a lot for Maddon not to like. The Cubs’ soul-crushing, 13-inning defeat the previous night seemed to have awoken the Giants, their October mojo now in full force behind the pitching of Matt Moore, who had held the Cubs to two hits through eight innings.