For lightning network, I have no idea if a similar approach is doable.
Actually, there is a thing called payment pre-image. Once the invoice is paid, the payment pre-image is given to the payer. Any node involved in the payment routing also knows it. It can be used to prove that the invoice has been paid.
How can you prove that you paid it if the merchant doesn't cooperate? Well, the invoice contains a lot of useful information. Node's public key and payment hash are the ones that should interest you. The payment hash is basically a hash of the pre-image which is known only to the merchant before he gets paid.