How to access and change a Tilemap’s Order in Layer?

I’m making a game about two ghosts, and an important thing that I want to add is the possibility to pass through walls. I have managed to make the passable behaviour and everything.

Next, I need to change the Tilemap’s Order in Layer number. That’s because I want to add some things inside the Tilemap that should be shown until player passes the wall. The way I though of to do this is to decrease the tilemap’s layer order when the player is inside it, and put it back to the previous value when player exits.