Jonathan David scored in the 74th minute, and Canada beat Peru 1-0 in the Copa America for its first victory over a South American opponent in 24 years.