Just cut a inch or so of the elbow off so that it has one long side and short.
The short side goes to the plumbing. Hopefully that will make it slim enough to fit into the box.
[][][][]
[]
[]
[][]
[]
[]
like in my bad diagram with the top one being the uncut pipe.
__________________
______________
Tim
|