
Looking at the first two cubes from left to right, the face opposite to the 6 cannot be a 1, 3 or 5 since they are immediately next to the 6. Also if we position Cube 2 so that 6 and 3 match up with Cube 1 then 5 and 1 are on opposite faces.
That leaves 2 and 4 to explore.
If we position Cube 3 so that the 3 on top of Cube 3 is is up against the 3 face of cube 2 the 4 will be on the bottom and 5 will be opposite the 1.
If we position Cube 4 so that the 4 and 5 are overlaid on Cube 3 then 3 and 2 are opposite one another.
So if we have 1 and 5 on opposite faces and 2 and 3 on opposite aces that leaves 4 and 6.