I think the full quote is "Winners never quit and quitters never win"... however by comparison "Quit while you're ahead" would not be contrary to the first. Quitting while you're ahead certainly implies the "quitter" in this case is the winner, no?
Several illustrative examples can be given, but one I've seen that I particularly like describes Sir Edmund Hillary and his Sherpa Tenzing Norgay climbing Mt. Everest on May 29, 1953. After reaching the top, they stopped climbing and came back down... surely they were not quitters but winners in a big way.... and certainly quit while they were ahead...