The castle, which attracts about 460,000 visitors per year, beat competitors including Edinburgh Zoo and Dynamic Earth.
Winners in 17 categories were announced at an awards ceremony in Glasgow.
The castle's executive manager Liz Grant said winning the award was a "wonderful achievement".
She said: "Scotland's heritage attractions, such as Stirling Castle, form an important part of the country's wider tourism and leisure offering and it's great to see this recognised.
"This accolade is made doubly special as it is initially voted for by members of the public and our visitors."
Stirling Castle has been named Scotland's best visitor attraction at the inaugural 2016 Scottish and Outdoor Leisure Awards.