The following should help:
The container has Yandex-maps set the z-index equal to 1. Simply set the value larger (for example, z-index: 500) and specify the absolute position (position: absolute) your legend. And then set the position of the legend using the properties left and top.