An outburst powered by the merging of two stars inside the envelope of a giant