The young star cluster population of M51 with LEGUS - II. Testing environmental dependences