The US firm said it believed the claims were without merit and would vigorously pursue all appeals.
The civil case was brought by Worldwide Directories and Ideas Interactivas against Yahoo! and Yahoo! De Mexico.
The two firms claim to have suffered breach of contract, breach of promise and lost profits arising from contracts related to a listings service.
Yahoo! said the ruling by the 49th Civil Court of the Federal District of Mexico City was only a preliminary judgement, and vowed to fight on.
It was not immediately clear when the lawsuit had been filed against Yahoo!.
Worldwide Directories and Ideas Interactivas could not immediately be reached for comment.
Documents from local courts in Mexico are not available for public consultation.
Shares of Yahoo! were down 1.7% at $18.45 in after-hours trading in the wake of the news.
In October, Yahoo! reported that its quarterly profit rocketed above $3bn (£1.9bn), fuelled by the sale of part of its stake in Chinese e-commerce giant Alibaba.
The Californian company's revenue from display advertising was little changed from the same quarter last year.
But Yahoo! said its income from adverts which appeared alongside online search results was up by 11%.