I also faced a similar issue as I wanted to link an already submitted invoice and order which were created afterward.
After digging into the code, it looks like sale order and sale invoice are linked through the sales invoice items. If you look at the db table for Sales Invoice Item there is a column named sales_order by setting it to the name of the desire sales order, it seems to link the two at least in the UI.
Note that this is not an official but rather a hacky way which I am not sure it 100% works. Nevertheless, I hope this could help some of you.