The 6-1 favourite beat 50-1 outsider Poyle Vinnie by half a length in the 25-strong field with Ninjago (33-1) third and Toofi (10-1) fourth.
He became the first three-year-old to win the race since 2002.
"He's a horse I've always loved and this is a race I've always wanted to win," said Hamilton.
"He's done it a bit too well really as I was in front too soon but we've got away with it."
The win in Ayr gave trainer Richard Fahey a Gold and Silver Cup double after Tatlisu beat stable mate George Bowen earlier on the card.
In all, Fahey won six races around the country - three of the winners, like Don't Touch, owned by financier Nicholas Wrigley and businessman Kevin Hart - which took the stable's winnings for the season past the £3m mark for the first time.
Fahey said: "You need a proper horse to win this. You've got to be progressive and nearly be a Group horse."
Don't Touch extended his unbeaten run to five by winning the William Hill Ayr Gold Cup in a tight finish under jockey Tony Hamilton.