Before Miguel Sano delivered the walk-off winning hit Tuesday, he received some advice from Oswaldo Arcia, who hit a walk-off home run Monday.

Arcia told him he could be a leader and play a big factor in the game.

“And don’t swing at the breaking ball,” Arcia added.

Sano listened.

With one out in the ninth inning, he took a nasty breaking ball from reliever Cody Allen for a strike. Two pitches later, he lined a fastball to center for a single that scored Brian Dozier with the winning run as the Twins edged Cleveland 6-5, their second walk-off victory in as many nights.

Twins righthander Ricky Nolasco pitched 7 ⅓ innings — the longest outing by a Twins starter this season — and the Twins looked ready to ride Eddie Rosario’s solo homer in the sixth to victory. But Cleveland’s Mike Napoli homered into the second deck off closer Kevin Jepsen (2-3) to tie the score with two outs in the top of the ninth. The fastball was just above the strike zone.

“We have been able to elevate [pitches] with [Napoli] this series,” Twins manager Paul Molitor said. “He was ready for that one.”

Danny Santana led off the ninth with an infield single but was thrown out trying to steal second. But Dozier doubled to right — his third opposite-field hit of the game — and Joe Mauer was walked intentionally to bring Sano to the plate.

A free pass to the three-time batting champion, who is hitting like a three-time batting champion again, to bring up a young righthanded hitter seemed to make sense.

“[Allen] is probably thinking, ‘I’m going to take Sano out. Don’t pitch to Mauer, pitch to Sano. Try to make [him hit] into a double play,’ ” Sano said. “But I be more smarter than the pitcher.”

As the single landed in center, Sano motioned to the dugout as he ran to first while Dozier crossed home plate. Soon, Rosario dumped a bucket of bubble gum on him — yes, he grabbed a bucket and ran onto the field with it — before teammates mobbed him. Then he was doused with water while being interviewed by Fox Sports North.

Smiles everywhere. A sense of relief. That’s what two walk-off victories will do for a team after getting swept in three games in Washington over the weekend, with the last game a 16-inning march to their 14th loss.

“We’re playing a lot of these kind of games,” Molitor said of his team, which has played 14 games decided by two or fewer runs and three in a row decided by one run. “Just one run either way. Sometimes it’s just catching a break.”

Nolasco was effective for a fourth consecutive outing, but he gave up two runs in the sixth that tied the score 4-4. Rosario, with two outs in the sixth, hit the first pitch from Indians starter Cody Anderson into the seats in right for his third home run of the season. It was Anderson’s 98th and final pitch.

That lead didn’t hold, but the Twins came through in the ninth. At 7-14, they remain in quite a hole, but winning in the final at-bat a couple of times can do wonders for a struggling team.

“Just to continue to compete,” Molitor said. “We all knew Sunday was tough. We had to turn the page and get back to trying to have a good homestand.”