The 20-year-old Scotsman overhauled Colombian rider Brayan Stiven Sanchez Vergara on the line to snatch gold.
Jason Kenny was fifth in the keirin, having been fourth in the team sprint with Philip Hindes and Callum Skinner.
Katy Marchant fought back through the repechages to make the sprint semi-finals before finishing sixth.
Britain's Mark Stewart captured his first senior gold medal with victory in the scratch race on day two of the UCI Track Cycling World Cup in New Zealand.