The Cowboys (3-1) fell in a 14-point hole early in the second quarter before taking over the game behind a pair of rookies who have helped the team get off to a fast start this season with starting quarterback Tony Romo sidelined by a back injury.
Elliott then took over with 96 yards rushing in the second half, including a 1-yard run that gave Dallas the lead for good late in the third quarter.
Blaine Gabbert got off to a fast start to help San Francisco (1-3) take the early lead but struggled to generate any offense after that. Gabbert finished 16 for 23 for 196 yards with one touchdown and one interception .
He had a chance to lead a late tying drive but he threw a 3-yard pass to Torrey Smith on fourth-and-6 from the Dallas 35 to end hopes at a comeback.
Copyright 2016 by The Associated Press