One day after absorbing a heartbreaking extra-inning loss at Wrigley Field, the Giants managed to flip the script on the Cubs. Matt Chapman delivered a go-ahead single in the top of the 10th inning to lift the Giants to a 2-1 win in Sunday night’s series finale on the North Side, securing a 5-5 road trip for San Francisco. “We needed this one tonight,” Chapman said. “There were a lot of opportunities that both teams had, and there was some crazy back and forth. Our bullpen was able to come in and shut it down. We played good defense. To get that hit in the 10th -- it felt good to put us up.” Before Chapman came through with his clutch hit, the Giants appeared to be in danger of getting walked off for the second straight day. The Cubs threatened in the bottom of the ninth after putting runners on first and second with two outs against Keaton Winn, who surrendered a game-tying home run to Pete Crow-Armstrong on Saturday that set up Chicago’s 3-2 walk-off win in 10 innings. But Winn didn’t buckle this time around, coaxing a groundout from Crow-Armstrong to preserve a 1-1 tie and send the game into extras. Winn said he thought Crow-Armstrong was sitting on his splitter in the previous game, so he made sure not to throw him the same pitch in the zone during their rematch on Sunday. “It felt good,” Winn said. “I kind of learned my lesson, I guess, the night before. But I felt good today and made an adjustment to go out and do it again.” The Giants subsequently went ahead in the top of the 10th, when Chapman stroked a single to right field that scored pinch-runner Jonah Cox -- the automatic runner -- from second base. Right-hander Dylan Smith took over in the bottom of the 10th, striking out Michael Conforto and coaxing popouts from Michael Busch and Alex Bregman to leave Crow-Armstrong stranded at third and earn his first career save. “Smitty is a confident guy,” manager Tony Vitello said. “He’s been in a lot of fires. Right away, we bring him up and he’s in an extra-inning game for us. He made us look good.”