As mentioned by Fabian Röling in a comment, there is a way to do it by continuously setting blocks with commands.
Here are the steps to do it:
1) Set down 4 repeating command blocks. If the area is not square or rectangular, you may need more (just enough to cover the entire perimeter with
/fill). They must be repeating command blocks or it will not work.
2) For each of them, set the command to
/fill x1 y1 z1 x2 y2 z2 minecraft:air, and replace the 6 parameters with the coordinates of one side of the area filled with lava. Do this for each side around the area with lava.
3) Turn the command blocks on, and they should continuously fill the borders of the lava-filled area with air, thus preventing it from expanding and keeping it contained to one area.