They have different meanings: Year 5 is not the same as fifth form. A year 5 pupil is nine or ten; a 5th form pupil is fifteen or sixteen.
Year 5 refers to the current state school system in England and Wales*, which begins in Year 1 when children are five years old and covers both primary and secondary school education. Year 5 is the penultimate year of primary education, when children are nine and ten years old.
'Fifth form' refers to a previous system for naming years in secondary schools. The form system is no longer used in state schools in England and Wales, but it is still used in some private schools. Fifth form used to be the last year of compulsory school, ending when students were 16 years old. They would then either leave school, go to a different establishment ( e.g. training college) or move up to sixth form to study for A levels. Even though the first to fifth forms effectively no longer exist in state education, the term 'sixth form' and 'sixth form college' are still used, and secondary schools sometimes still refer to the students' "home room" teacher as 'form teacher' and their home room group as 'form'.
* Note that this only applies to England and Wales, not the whole of the UK. Scotland and Northern Ireland have their own systems.