He held off van Gisbergen through the opening stint and looked like he would claim the championship in a canter but drama struck at the end of the first stint when he was the third driver to be handed a pit lane penalty for speeding during his first stop.
Replays showed he had engaged the pit lane speed settings that keep the car under the 40km/hr limit but was still judged to have gone too fast as he crossed the pit entry line.
The Shell V-Power driver fought his way back to a position where he had done enough to take the title but made an error on lap 47 in trying to pass Simona de Silvestro and turned her Nissan around. He was given a 15 second time penalty, which he served at his final stop.
A safety car helped bunch the field up for McLaughlin but Red Bull reacted by getting van Gisbergen to pull over and let Whincup go past for the lead of the race on lap 60.
McLaughlin forced his way past Chaz Mostert and Scott Pye upon the resumption.
Another safety car intervention bunched the field up yet again but there was all sorts of drama on that re-start as he bounced between cars diving everywhere at the first corner. McLaughlin's Ford suffered left rear damage as a result but continued.
On lap 90, with an ailing car, he took a major dive at Garth Tander and somehow managed to make the move stick.
He then forced his way by his great friend James Moffat but Craig Lowndes made a move a moment later. McLaughlin moved over on him and they touched, sending the veteran off and into the wall.
Race control had the call to decide the title and they ruled against the Kiwi.
"I just gave it my all," a shattered McLaughlin said. "I lost my left hand mirror so early. Obviously I knew we were close but I didn't think we were that close and I just defended my lines at two and then we got interlocked and got caught up and I genuinely didn't mean to push him into the wall.
"And then to pinged like that – anyway mate – whatever.
"It is hard. I just feel sorry for the guys – we shouldn't have been in that position.
"I'm so sorry."
Despite the heart-break McLaughlin vowed to bounce back.
"I'm 24 years old I have a few cracks at it."
Reigning series champ van Gisbergen was torn with emotion after the race. He was elated for his teammate but also gutted for his countryman.
"The unthinkable happened today. I feel for Scotty – it really sucks. But Jamie – that is why he has won the championship so many times - so consistent and no mistakes and well done to him."
Whincup didn't know he'd won the title until his team told him over the radio after he crossed the finish line.
"I am lost for words. I didn't have a clue – I assumed I had come second.
"Great day for Holden and great day for Red Bull.
"We didn't have the quickest car all year but it is all about teamwork and sport is all mental. Rapt – couldn't be happier.
"Just a massive thanks to the whole car #17 crew. They absolutely stepped up this year and gave us an unbelievable fight. Commiserations to them – no doubt Scotty will go on to win the next eight but glad we got one."