Jon Gruden said he learned from Bill Walsh a long time ago: never count out greatness.

With that in mind, the ESPN “Monday Night Football” analyst is eager to see whether Randy Moss can shake off the rust and make an impact with the 49ers.

“I always took pride as a coach in learning from Bill Walsh: If a player has played great before, there’s a chance he can play great again,” Gruden said Thursday.

The 49ers signed Moss, 35, during the offseason in hopes that he can resurrect the form that made him one of the NFL’s all-time leading receivers. Moss is tied for second in touchdown receptions (153), fifth in receiving yards (14,858) and ninth in receptions (954).

But he spent last season in retirement. In the forgettable season before that, he managed just 28 catches and 393 yards for the Patriots, Vikings and Titans.

To Gruden, luring Moss out of retirement has echoes of Walsh. On a conference call to promote ESPN’s upcoming “MNF” season, he recalled how the 49ers fueled their dynasty by relying heavily on veterans such as Fred Dean, Hacksaw Reynolds and Matt Millen, to name a few.

“Those were the guys who came in at the end of their careers and had a major stake in the 49ers turning it around,” Gruden said.

Gruden began his NFL coaching career as 49ers quality control coach in 1990. George Seifert was the head coach by then, but Gruden also got to know Walsh, who was freshly retired from a 49ers career in which he won three Super Bowls.

Now, Gruden is eager to see if another veteran can do what the likes of Dean, Reynolds and Millen did years ago.

“It all depends on where Randy is — physically, mentally, emotionally,” he said. “If he has 90 percent of what he once had, he can help anybody. But that’s the great unknown. It’s going to be interesting to see.”