Longwell's go-ahead kick was set up when Erin Henderson picked off a Tony Romo pass at the Dallas 22-yard line with 7:33 to go.
Randy Moss caught five passes for 55 yards and Percy Harvin ran back the second-half kickoff 95 yards for a touchdown.
Romo was successful on 25 of his 33 pass attempts, gaining 216 yards and hurling three touchdowns. But he also yielded a pair of costly interceptions that set up a total of 10 Vikings points.
Roy Williams hauled in two touchdown catches and Dez Bryant also scored for the Cowboys (1-4), who were whistled for 10 penalties totaling 91 yards.