Dynamic lightning is always more difficult than it seems at first, you need skills on programming.
I´m not sure how to achieve this, but, what about setting an array with black tiles, and then, turn their opacity by checking distance to player.
A simple grid that can not only check distance to player but also check if its another object in it, for example, dirt or water or nothing, so you can turn the opacity in order of qhat is colliding