TAMPA — A coach coming to the mound previously led to one of Carlos Rodon’s worst moments as a Yankee.

On Monday, the scene served as a feel-good moment, as much as it could for a spring training game.

Rodon had just thrown his 72nd and final pitch across 5 ²/₃ no-hit innings against the Phillies when Joe Torre, a special guest at camp for a few days, began his walk out to the mound to take the ball.

Yankees starting pitcher Carlos Rodon (55) throws a pitch against the Philadelphia Phillies in the second inning at George M. Steinbrenner Field.Nathan Ray Seebeck-USA TODAY Sports

The competitive Rodon, still in the zone, knew he had three pitches remaining in his allotment and was about to face a left-handed hitter.

“I was like, ‘What the hell, it’s a lefty?’ I look up and I was like, ‘Oh, it’s Joe Torre. I should give him the ball,’ ” Rodon said with a laugh. “I was like, ‘All right, I can’t really say much here.’ Spring training game, Joe Torre, yeah. So I had to give the ball away. It was funny. It was cool.

“I wanted to be like, ‘Get out of here,’ ” Rodon added, “but it’s Joe Torre.”

Between the former Yankees manager making a cameo and Rodon having put together an encouraging outing, the crowd at Steinbrenner Field delivered a loud ovation.

Torre spoke with Rodon for a few seconds as his infielders surrounded him, including Anthony Volpe smiling ear-to-ear.

“He was just saying that was a lot easier to take the ball from him there than [Andy] Pettitte,” catcher Austin Wells said. “I thought that was pretty funny. … That was really special.”

The Yankees hope there are more feel-good moments to come from Rodon, who struck out five and walked one during his penultimate start of the spring.

Coming off a brutal first season in pinstripes — including turning his back on pitching coach Matt Blake in his season finale last year — the $162 million left-hander had gotten off to a shaky start this spring before delivering back-to-back solid outings in which his fastball velocity ticked back up.

It averaged 94.6 mph on Monday and topped out at 96.4 mph.

Yankees former manger Joe Torre brings out the lineup card for a game against the Philadelphia Phillies during spring training.USA TODAY Sports via Reuters Con

The Phillies were playing a split-squad game, so they did not bring anything close to a full lineup. Their only regulars were Alec Bohm, Brandon Marsh and light-hitting outfielder Johan Rojas.

Still, having success against any kind of lineup should be beneficial to Rodon as he tries to rediscover his swagger.

“It’s coming along,” Rodon said. “Just keep building confidence. Today was another good step.”

Manager Aaron Boone liked what he saw from Rodon but was less focused on the results.

“Look, he’s in a good place,” Boone said. “I’m going to keep saying this — good, bad, indifferent — it’s just about stacking really good days. That’s what he’s been doing for months now. I want him to focus, get ready, go to the post. Now it’s, ‘What do I do the next days to get ready for my next start?’ If he keeps doing that and where he’s at, in the end he’ll be successful.”

Carlos RodonNathan Ray Seebeck-USA TODAY Sports

For now, Monday was just another building block with a special twist at the end.

Boone had been working on getting Torre to make a pitching change for a few days — first by getting him in uniform for the first time since 2007 and then convincing him to take the walk to the mound from their side-by-side seats by the Yankees dugout.

“Today, he was like, ‘All right, let’s go,’ ” Boone said. “He was even going to take the [catcher’s] wristband out, I said, ‘No, don’t take the wristband.’ He said, ‘Well I may need a map to get out there.’ But it was awesome. What a treat to have him here the last few days. Our guys loved it. I think Joe really loved it. Certainly for me, to have him, just an ear to bend. It’s been great.”