1660s, native to South America and perhaps so called either because it was first brought back to Britain aboard Guinea-men, ships that plied the triangle trade between England, Guinea, and South America [Barnhart, Klein]; or from confusion of Guinea (q.v.) with the South American region of Guyana (but OED is against this). In the extended sense of "one subjected to an experiment" it is first recorded 1920, because they were commonly used in vivisection experiments.
guinea pig guin·ea pig (gĭn'ē)
Any of various small, short-eared domesticated rodents of the genus Cavia, having variously colored hair and no visible tail. They are widely kept as pets and often used as experimental animals.
Person or thing used in an experiment, sometimes without agreement: the guinea pigs for her cooking