Kailer Yamamoto, Evander Kane, and Leon Draisaitl scored, and Connor McDavid had two assists for the Oilers (35-24-5), who had their six-game point streak end. Koskinen made 23 saves.
It was the first game the Oilers have lost when scoring first this season (previously 21-0-0).
"I thought it was a good game," Draisaitl said. "Obviously, we could have been a little sharper on those plays at the end there. But the desperation level is high with a lot of teams right now, so just a couple of mistakes, that can't happen. All in all, pretty solid effort again."
Yamamoto gave Edmonton a 1-0 lead at 16:31 of the first period when he deflected Evan Bouchard's slap shot from the point.
Robertson tied it 1-1 at 6:37 of the second period when he took a cross-ice pass from Benn and shot five-hole on Koskinen.
Pavelski put Dallas in front 2-1 at 7:57 with a power-play goal. Klingberg's shot from the right point hit Koskinen's blocker and popped into the air before landing at the skates of Pavelski, who converted on the rebound.
"The guys were confident on the bench that we were playing well," Stars coach Rick Bowness said. "Because of the looks we had in the second period, we knew we were going to get some opportunities to stay in the fight. We had some players go out there and they were determined to make a difference in the outcome of the game, and they did. It was a great hockey game."