© AP Photos
Gignac had an early chance as he tried to head the ball into the back of the net in the fourth minute and the striker was able to break the deadlock eight minutes later with a powerful effort from just outside the box.
The French forward had two more chances saved before half time, as the Bastia defence struggled to contain his pace.
Despite the home side's dominant display in the opening 45 minutes, the visitors were back on level terms early in the second half, as Florian Thauvin curled the ball in from the edge of the box just seconds after the re-start.
Gignac, Jordan Ayew and Morgan Amalfitano all had chances to restore Marseille's lead shortly after, but it was the 81st minute when Gignac completed his brace, tapping in from a Mathieu Valbuena delivery.
The 27-year-old had a chance to seal a hat-trick in stoppage time, but just drifted into an offside position.
The result leaves Marseille second in the Ligue 1 table, while Bastia sit 13th.