Williams had 10 double-faults to five for Dementieva, but converted eight of 10 break points. The two engaged in powerful baseline rallies.
"It was just really competitive out there,'' Williams said.
Serena Williams beat Dinara Safina, 6-4, 6-1, and Vera Zvonareva defeated an ailing Ana Ivanovic 6-3, 6-7 (5), 6-4, avenging a lopsided loss to the Serbian in the final of the Generali Ladies tournament last month in Linz, Austria.
Zvonareva won on her third match point when Ivanovic, who took a medical time-out in the first set, hit a forehand into the net.
The French Open champion said she had a sore throat and hadn't eaten much in the past couple of days because of a virus.
"It was very hard for me to breathe,'' Ivanovic said. "I was struggling.''
The ninth-ranked Zvonareva improved to 3-4 against Ivanovic.
Zvonareva has won two group matches while Ivanovic has lost two, and is close to elimination. They have one more round-robin match.
Eight players are divided into two groups of four, with the top two in each group advancing to an elimination stage. The Williams sisters play each other on Thursday.
Zvonareva defeats Ivanovic at WTA Championships
Guardiola: Basel Are No Pushovers