The direction you can get from your movement vector (You can compute the angle of the movement vector which would give you the direction). However, this is likely not failsafe.
You need a way of finding out if your sprite2 (or Sprite) is the wall or the floor. Then you know for sure if it was the floor or a wall.
If I understand you correctly, you are using a single sprite which serves as a wall and moves into the floor as well, correct? In that case, using the direction still isn't failsafe. You could either fall onto the wall with a pretty steep angle, but still be hitting the wall, or you could touch the floor with a pretty flat angle, but still touch the floor.
I would suggest maybe using the height of the player as a metric, let's say the player is standing on the floor. The difference of the y coordinate and the bottom of the floor is maybe 100px. If you detect a collision, check the height difference of the player. If it's < 110px you hit the floor, else the wall.
Another option would be separating the sprite from multiple bounding boxes, or splitting the sprite into two separate ones, so that they still look connected in-game, but are in reality two separate sprites.
That's my thought process without seeing any actual code.