When someone wins by a small margin, we often use the expression "by a whisker." However, there are other phrases with similar meanings that you can use to vary your writing or speech. For example, "by a hair's breadth" means the same thing as "by a whisker." You could also say "by a nose," which is another way of saying that someone just barely won. "Just squeaked by" is another option, implying that the person won by the narrowest of margins. Other synonyms for "by a whisker" include "by a thread" and "by the skin of one's teeth." Whichever phrase you choose to use, you'll be able to convey the idea of a narrow victory.