Swindon failed to register a shot on target in the first half as keeper Lawrence Vigouroux kept them level.
Robins forward Jon Obika forced a save from Tykes keeper Adam Davies after the break before Fabien Robert's ambitious volley was easily saved.
But Winnall thrashed home Josh Scowen's cross for his ninth goal in six league games to hand new Town manager Luke Williams his first defeat.
Sam Winnall's strike secured a sixth successive League One win for Barnsley.