A labour court in the capital of Brasilia issued a temporary injunction saying the breaks are required near the 30th minute of each half so players can get hydrated. FIFA had said it would only implement the breaks when its medical staff considered them necessary.
The court said in a statement that the ruling was made after nearly two hours of failed negotiations involving FIFA and local prosecutors in an audience on Friday.
Brazil's players' union recently took legal action against FIFA to try to change the start times of more than a third of World Cup matches because of heat and humidity.
Prosecutors wanted the breaks to be implemented when the temperature reached 30 degrees Celsius (86 Fahrenheit), but the judge said that he would accept FIFA's limit of 32 degrees Celsius (89.6 Fahrenheit) because it wasn't evident that the small difference would "endanger the players' health."
The judge said the injunction was needed because there was nothing assuring that FIFA would enforce its own guidelines.
"I think that obliging FIFA to enforce its own norm is not a measure that jeopardizes the competition," judge Rogerio Neiva Pinheiro said in his ruling.
FIFA said it would "fully respect" the court decision.
"The labour court in Brasilia fully confirmed FIFA's own set of pre-established guidelines for the implementation of cooling breaks during the FIFA World Cup which had already been applied consistently since the opening match," FIFA said in a statement sent to The Associated Press. "FIFA will continuously apply its related guidelines throughout" the tournament.
The judge said FIFA must pay 200,000 reals (about $90,000) for each match in which the ruling isn't enforced.
It also said the governing body is responsible for registering the temperature during matches by using certified equipment.
Brazil's players' union had demanded FIFA changed kickoff times of all 24 matches that were scheduled for 1 p.m. local time (1600 GMT), saying it wanted to avoid subjecting athletes to the "risks" of playing in "intense heat."
FIFA had said at the time that it would not change the start times, or make the cooling breaks mandatory, because it spent nearly two years analyzing the tournament's schedule and always took into consideration the players' health.
FIFA last year altered the starting times of seven World Cup matches in the most hot and humid host cities.
Winter is starting in Brazil, but it remains hot and humid in many of the 12 host cities, especially in the northeastern and northern regions.
There was special concern with the jungle city of Manaus, where humidity is expected to significantly affect players' performances. It happened in the England vs. Italy match last week, when players and fans complained of the conditions.
Tales Azzoni on Twitter: http://twitter.com/tazzoni