The 21-year-old came through the Paisley side's academy and has made 112 appearances for them in all competitions, scoring 29 goals.
Mallan told the official Tykes website: "I am very excited to take the next step in my career. Something I always wanted to do was come down to England to try and make myself better.
"I definitely feel like Barnsley was the right choice to make so I am excited to get working with all the other boys.
"I have seen them come up from League One and finish 14th, which is an amazing achievement, so I am looking forward to getting started and hopefully adding to the squad."
Mallan, who joins the Oakwell outfit for an undisclosed fee, scored 11 goals this season to help the Buddies retain their Scottish Championship status.