We consider generalized Melvin-like solutions corresponding to Lie algebras of rank 5 (A5, B5, C5, D5). The solutions take place in a D-dimensional gravitational model with five Abelian two-forms and five scalar fields. They are governed by five moduli functions H_s(z) (s=1,...,5) of squared radial coordinates z=ρ^2, which obey five differential master equations. The moduli functions are polynomials of powers (n1,n2,n3,n4,n5)=(5,8,9,8,5),(10,18,24,28,15),(9,16,21,24,25),(8,14,18,10,10) for Lie algebras A5, B5, C5, D5, respectively. The asymptotic behavior for the polynomials at large distances is governed by some integer-valued 5×5 matrix ν connected in a certain way with the inverse Cartan matrix of the Lie algebra and (in A5 and D5 cases) with the matrix representing a generator of the Z2-group of symmetry of the Dynkin diagram. The symmetry and duality identities for polynomials are obtained, as well as asymptotic relations for solutions at large distances.