Ayr United made history by becoming the first club to use a fourth substitute during extra time in their Scottish Cup win against Queen's Park.