You cannot take the 5-ft-step if you have used your move action (or made a double-move) to cover any distance moving.
So you can't move your speed, attack once, and take a 5-ft-step back.
But if you use your move action to make a move-equivalent action that doesn't let you actually cover any distance - or even make a double-move with two such actions - you can make the 5-ft-step.
So you can stand up from a prone postion (move-equivalent), move 5 feet, and attack then. You could even stand up form the prone postition (mea 1), draw your weapon (mea 2) - so you made a double move), and still make your 5-ft-step.