When a manager makes a substitution 5 minutes from time it is usually to try and waste a bit of time or disrupt the flow of play of the opposition, particularly if it is to protect a lead. When losing 2 - 0, presumably a manager makes a substitution for tactical reasons, if so, surely you have to allow more than 5 minutes for it to have some effect?
The substitution by Martinez was a complete waste of time with absolutely no logic.