In my personal opinion, it is possible to compare 5-min baseline HRV against 10-min task HRV. Even shorter durations of 1-min has been suggested to correlate with 5-min segments (PMID: 34211411). However, whether it is technically correct to compare 5-min vs 10-min segments will be dependent on whether expected HRV changes with your task is time dependent (do you expect difference between first 5 and last 5-min of the task?). Without knowing the exact task at hand, it may be difficult to conclude.
If unsure, I'd suggest to segregate post-task HRV in 5-min blocks and analyze to see if any differences exist (such as has been performed in PMID: 33300852). In any case, peer review may still request this information to justify the differences in analysis durations pre- and post-task.
Thanks for the answer. Yes, I do expect the HRV should not change over time. The task was an economic game. Maybe I take an average of 5-minute segments? What are your thoughts on outlier removal with respect to HRV?