Answer
Yes, they are like terms.
Work Step by Step
The commutative property of multiplication says that the factors can be written in any order without changing the product.
$-5yx^2=-5x^2y$
Since the variables in both expressions are $x^2y$, they are like expressions.