After 160 laps and more than six hours, it all boiled down to one final hot lap after the last in a series of late Safety Car periods.
McLaughlin, whose co-driver Alex Premat became the first Frenchman to win Bathurst, crossed the finish line a mere 0.6800s ahead of the Red Bull Holden of van Gisbergen/Garth Tander.
The reigning series champion had done it all in the sport but win Bathurst, and delivered Dick Johnson Racing’s first win at the Mountain in 25 years and the first since Team Penske’s majority buy-in.
“I can’t believe I won the bloody Bathurst 1000!,” McLaughlin said.
“We had such a good car all week, I put so much pressure on myself, our whole team put so much pressure on themselves to make this a good one.
“I’m so proud of everyone. We made a bloody good car. I’ve dreamt about this, standing on that roof.”
Premat added: “That was so stressful, that was insane. We were gambling, gambling [on fuel], that was crazy. I am so happy to win this race… it’s magic.”
James Courtney and Jack Perkins took a sensational third for Walkinshaw Andretti United, surviving a clash with the wall and Perkins’ flu recovery to hold off Jamie Whincup.
The Whincup/Craig Lowndes Holden had entered the final phase of the race in the lead as fuel concerns became front of mind following an ill-timed Safety Car.
Short on fuel, Red Bull crucially decided to pit under a later Safety Car with an 11s lead in hand, giving up track position that it would not regain, finishing fourth.
McLaughlin, who had his hands full in the final 10 laps defending van Gisbergen while fuel-saving, was helped by a final Safety Car period after Andre Heimgartner’s race ended in the Forrest’s Elbow barriers.
Heimgartner’s battered Nissan was dragged off the racing line in time to give one lap in green conditions to the flag, during which McLaughlin would never really look in doubt.
McLaughlin cut an emotional figure to tick Bathurst off his bucketlist, having steered the fastest ever lap around the Mountain the day before in the ARMOR ALL Top 10 Shootout.
After a first 100 laps that featured brilliant racing and minimal accidents, a Todd Hazelwood crash sparked a thrilling stop-start run home.
But it was the race’s fourth Safety Car on lap 123 that really triggered a chaotic sequence of events and scenes of fury inside the Tickford Racing camp.
Chaz Mostert overcooked an attempted pass on teammate Cameron Waters on the outside on entry to The Chase, collecting the Monster Energy Mustang and firing them both into the sand trap.
It marked the third straight Bathurst that the Mostert and Waters cars had been involved in an incident, the former copping a drive-through penalty.
A clearly miffed Tickford boss Tim Edwards denied an interview on the television broadcast before an emotional and “gutted” Waters opened up on his heartbreak.
The pair had been third and fourth on the road at the time. Mostert would later set a new race lap record, a 2:04.7602s, on his way to 16th.
The Safety Car returned immediately after the race had resumed when a jammed throttle sent Anton De Pasquale firing into the wall at Reid Park.
The green flags were back out for lap 130, but it would be only five laps before a sixth Safety Car intervention was required after 2016 Indy 500 winner Alexander Rossi beached his Walkinshaw Andretti United wildcard at Murray’s Corner.
That compromised what had otherwise been a solid race for Rossi and Canadian co-driver James Hinchcliffe.
As cars prepared to dash into pitlane – Whincup leading the queue from McLaughlin – third-placed Fabian Coulthard controversially backed up the pack as he prepared to double-stack behind his teammate.
Coulthard was subsequently issued a drive-through penalty, taking the #12 out of contention after it had run so strongly earlier in the race.
The timing of the Safety Car put every entry on the brink with fuel saving.
James Golding entered the restart a shock third but soon headed into the pits as Boost Mobile Racing decided against gambling with fuel.
He looked set to score a terrific result, sitting sixth before having to pit on lap 148 after reporting a vibration.
That installed 2017 Bathurst winner David Reynolds as the lead driver to have pitted since the Safety Car, putting him in a position to pounce should the five competitors ahead run into fuel dramas.
Whincup and McLaughlin duked it out after the restart before going separate ways on strategy, Red Bull banking on another Safety Car to get home and Shell V-Power entering heavy fuel-saving mode.
The seven-time championship winner streaked away to open up an 11-second advantage at the front of the field before another Safety Car spiced things up.
Richie Stanaway and Garry Jacobson collided at Hell Corner after rubbing panels down pit straight, with the latter finishing buried in the gravel.
It was at that moment that Red Bull pulled the trigger, bringing Whincup into the pits.
McLaughlin, van Gisbergen – whose driver’s door had been flapping loose earlier in the day – and Courtney went by, with Whincup rejoining in fourth, now the lead driver without fuel concerns.
Some staunch Courtney defence dented Whincup’s hopes, the departing Walkinshaw Andretti United star refusing to budge from a podium spot.
The net result was a straight shootout for the victory between McLaughlin and van Gisbergen, less than a second splitting the Kiwis.
As van Gisbergen hounded the back of the #17, the Heimgartner-caused Safety Car gave McLaughlin a chance to catch his breath, and save crucial fuel.
The order would not drastically change on the last lap, Reynolds finishing fifth ahead of Coulthard, Mark Winterbottom, Scott Pye, Rick Kelly and Lee Holdsworth in 10th.
Earlier, the polesitting Shell Ford had moved to the front when co-driver Alex Premat capitalised on a pair of Lap 91 errors for Craig Lowndes.
Lowndes tagged the wall on the run through Reid Park and then ran wide at Murray’s Corner, opening the door for Premat to make a pass at the very next corner.
As most of the lead group pitted, staying out longer didn’t work out for James Moffat and van Gisbergen, both cars getting trapped behind the Safety Car when it was deployed on Lap 101 – exactly 100 laps after the previous caution period began.
The stricken Commodore of Hazelwood was the catalyst, the Matt Stone Racing driver whacking the wall at Sulman Park to join Tim Slade in the DNF category.
Moffat and van Gisbergen spent an entire lap behind the Safety Car before peeling off to pit, the #97 rejoining ahead of Moffat’s lead driver Mostert in ninth and 10th.
McLaughlin soon checked out at the front of the field, opening up a 3.5s buffer to Whincup within five laps and Coulthard a further three seconds back in third.
The next stoppage would be caused by Jake Kostecki pin-balling his way through Reid Park.
The #56 came to a stop perpendicular to the track, ending a tough debut for the wildcard entry and triggering a flurry of pitstops.
Coulthard, van Gisbergen, Kelly and Pye were forced to double stack but the biggest change was at the front, Whincup narrowly jumping McLaughlin in the pits.
With a tight fuel race looming, Kelly and Pye opted to pit three times before the race resumed on Lap 117, an out-of-sequence Holdsworth was first from Whincup, McLaughlin and Waters – and there’d be more trouble to come, as elaborated above.
The Kostecki crash followed an unusual early incident which delayed the race start by 15 minutes after Brodie Kostecki suffered carbon dioxide poisoning following a cool box failure.
Brodie was forced to stop his Commodore at the start of Conrod Straight as he battled fumes, burning eyes and breathing difficulties.
He was taken to the medical centre and later cleared to take part in the race, with his car towed back in time for Jake to start the race from pitlane.
Slade was the first casualty of the day, unsuccessfully trying to run on the outside of Scott Pye out of The Cutting and finding the wall.
In the bigger championship picture, the result puts McLaughlin in with a real chance of sealing his second straight title on the streets of the Gold Coast in a fortnight at the third last event of the year.
McLaughlin now leads van Gisbergen by 622 points, ahead of Coulthard, Mostert and Whincup.