How to merge seperated Edge into Mesh?
Cut away all the connecting edges between the top and the bottom of the cube. (check the edge select -> remove only edges)
Join both meshes.
Select remaining edgeloop on top (top side of the former cube).
Select the edgeloop to introduce.
"Bridge Edgeloops".
Select the edgeloop you introduced.
Select remaining edgeloop on the bottom.
"Bridge Edgeloops".