We interpret the Leggett-Garg (LG) inequality as a kind of contextual probabilistic inequality in which one combines data collected in experiments performed for three different contexts. In the original version of the inequality, these contexts have a temporal nature and they are represented by three pairs of instances of time, (t(1), t(2)), (t(2), t(3)), (t(3), t(4)), where t(1) < t(2) < t(3). We generalize LG conditions of macroscopic realism and noninvasive measurability in a general contextual framework. Our formulation is performed in purely probabilistic terms: the existence of the context-independent joint probability distribution P and the possibility of reconstructing the experimentally found marginal (two-dimensional) probability distributions from P. We derive an analog of the LG inequality, 'contextual LG inequality', and use it as a test of 'quantum-likeness' of statistical data collected in a series of experiments on the recognition of ambiguous figures. In our experimental study, the figure under recognition is the Schroder stair, which is shown with rotations for different angles. Contexts are encoded by dynamics of rotations: clockwise, anticlockwise and random. Our data demonstrated violation of the contextual LG inequality for some combinations of the aforementioned contexts. Since in quantum theory and experiments with quantum physical systems, this inequality is violated, e.g. in the form of the original LG-inequality, our result can be interpreted as a sign that the quantum-like models can provide a more adequate description of the data generated in the process of recognition of ambiguous figures.