Mikaela Ruef had 10 rebounds and blocked three shots for the Cardinal (9-1), who host No. 3 Tennessee on Saturday.
Bryce Owens scored 12 points, all on 3-pointers, to lead the Lobos (4-5), who fell to 2-11 against teams ranked in the top 10.
New Mexico, which ranks second in the Mountain West Conference in scoring defense and first in rebounding margin, last beat a top 10 team eight years ago.
Ogwumike scored Stanford’s first 10 points and 23 of its first 25 before she was replaced by Erica McCall with 9:52 left in the first half.