Much more context needed. I'd consider it mildly unusual but not necessarily odd. And would depend a lot on the situation - eg my BFF went back to uni to do a post graduate degree a few years after she'd finished her first degree. Her course was filled with students who'd gone straight to post grad from undergraduate and so she became friends with many of them with a similar age gap.
Ditto, when I was 23, I worked somewhere and became friends with a woman who was 29.
On the other hand, a 20 year old female student becoming good friends with her 27 year old male tutor at uni, might be different.