Alan Gallagher, the first native San Franciscan to play for the Giants after they moved west and the third baseman on their 1971 National League West championship team, died Thursday in Fresno after a long battle with diabetes. He was 73.

Gallagher played at Mission High and Santa Clara University before the Giants made him their top pick in 1965, the draft’s inaugural year. He broke into the majors in 1970 and had his best year in 1971, the last year Willie Mays, Willie McCovey, Juan Marichal and Gaylord Perry all played together.

“He was one of the luckiest guys in the world,” his son, Sean Gallagher, said, “not only to be born and raised in San Francisco but to reach his dream to be a major-league baseball player and play in San Francisco. And then to be in the starting lineup with all those guys … Willie Mays was his favorite player. He was in absolute awe of him.”

In a Chronicle story in 2003, Gallagher recalled his big-league debut.

“Opening Day, 1970,” he said. “I was batting second, and Willie Mays was batting third. I remember Mays patting me on the butt and saying, ‘Go get ’em, kid.’ … I wasn’t on Cloud 9. I was in heaven.

“I will never forget that day. … It was quite a thing for the kid from the Mission.”

Known as “Dirty Al,” a nickname he earned in college that stuck through his career, Gallagher hit .277 in 1971. He played four seasons in the majors and was traded to the Angels in the first month of his final season.

“By 1973, I had a running feud with (manager) Charlie Fox,” Gallagher said. “It was just a couple of stubborn Irishmen. ... I was a streak hitter; he knew that. I wanted to play every day, and he wanted to platoon me.”

Gallagher demanded a trade, the “biggest mistake I ever made,” and was shipped to the Angels for infielder Bruce Miller. Gallagher’s career was shortened after he hurt his shoulder in a collision with Red Sox catcher Carlton Fisk.

“I hurt him so bad he played 21 more years,” Gallagher said.

Gallagher managed in the minors and independent ball and also served as a teacher in Fresno. His full name was Alan Mitchell Edward George Patrick Henry Gallagher.

“The story is that his parents wanted a very large family,” Sean Gallagher said of his father, an only child. “Once Dad was born, they gave him all the names.”

During a 25-game hitting streak at Santa Clara, where he was an All-American, Gallagher wore the same unwashed uniform, jock and underwear. Thus, “Dirty Al.”

John Shea is The San Francisco Chronicle’s national baseball writer. Email: jshea@sfchronicle.com Twitter: @JohnSheaHey