Telling a friend you like the same person is awkward. Them finding out secondhand is worse for everyone.
GRATITUDE
GRATITUDE
The awkwardness of saying it is small and it is yours. The awkwardness of them hearing it from somebody else is larger and it includes a second discovery, which is that you decided not to tell them. That second part is what damages the friendship, more than the overlap ever would. Most of these situations are survivable right up until one person finds out late.
Say it early, in one sentence, without a plan attached to it. Something as plain as liking the same person and wanting them to hear it from you. Then let them react however they react, and work it out between you.
What should your friend hear from you rather than from gossip?
Free, with nothing to buy inside it.