I would use a section of Romex semi flexible electrical cable to use as a template to determine the exact length. Simply "snake" it along the path you would like to take and get the exact measurement when you straighten it back out. I always keep leftover Romex to determine lengths when the cable has to take a weird route through stuff.
View attachment 1715827487