It might work, but I doubt a guitar's output is the same as a stereo components line out and I doubt the cmoy's headphone in jack put out the same signal as a true guitar pre-amp...but then again, you can vary that with the volume control. Also, home amps and especially home speakers are not robust enough to handle an electric guitar at anything but a very, very, very low volume. You can very easily blow your speakers.
Try it out if you'd like, but keep the guitar, cmoy, and amp volumes way down.