The 20-year-old Irishman played 15 games for Motherwell in the second half of last season, scoring twice.
Saints boss Derek McInnes said: "He's a player that I've tried to get on a couple of occasions.
"I'm delighted to get him on board.
"He'll give us competition; he's a different type of striker to the ones we have.
"Hopefully, he'll be good for us and us for him."