A mahout tried to separate the two animals by poking one with a sharp-edged hook, causing the elephant to run away in pain late Friday, a police official said.
“The elephant did not harm anyone, it was trying to get away from the mahout, but people panicked and started running,” a local police official told AFP by phone.
The Hindu temple in Ratnapura, 100 kilometres (60 miles) south of Colombo, was packed with devotees ahead of an annual pageant.
A 60-year-old woman died of a heart attack following the incident, while about a dozen others were hospitalised for minor injuries suffered in the stampede, the police official said.
“The situation was quickly brought under control,” he added.
Elephants are considered sacred in Sri Lanka and domesticated animals are frequently paraded at temples during Buddhist and Hindu festivals.
The country’s wild elephant population had dropped to 6,000, from some 7,379 five years ago, largely due to farmers encroaching on their natural habitat.
The number of domesticated elephants has also dropped considerably as the authorities no longer grant permits for the capture of animals from the wild.