Both braving it on slicks after rain began to fall just over halfway through, Pye led by four seconds when he locked up and went wide at Turn 13.
Whincup drew alongside as Pye scrambled back onto the racing line, but the Walkinshaw Andretti United Holden driver did just enough to keep the place.
“I had just changed my brake bias to the rear,” Pye explained to Supercars.com.
“I thought it was drier than it was, locked the rears, the engine cut off, it went silent, and my heart stopped until it fired again.
“I knew Whincup was three or four seconds behind at that point and I knew I’d lose about three or four seconds, so I just turned back towards the circuit and got on the gas as hard as I could and drove it to the inside so that he couldn’t overtake.
“That moment was certainly the biggest one of the race and could have cost me the race. After that I just kept saying to myself to ‘point and shoot’.
“We had a great car off the corners and I knew that by being safe on the way in, I could just focus on my exits, get a gap again and still get the win. It wasn’t over.”
Starting third, Pye moved to second off the start and inherited the lead when Scott McLaughlin speared off on the second lap.
Pye led Whincup and Chaz Mostert once the compulsory pitstops were completed and, while Mostert was among 10 to pit for wets, the lead duo stayed out.
The 28-year-old later admitted he had at one point told the team he wanted to pit, only staying out when he’d not heard a confirmation by the time he reached pit entry.
“There were a couple of decisions,” recalled Pye.
“The first one, Starry [engineer Rob Starr] said 'it’s your call'. It’s such a long lap, it’s hard to tell what the rest of the circuit is like.
“It was actually worse in some spots than others and I made the first call to stay out. At that point I didn’t want to give up track position, I wanted to fight for the win from the front.
“Then a lap or two later it rained a lot heavier and I said ‘we need to pit, I want to pit’. There was radio silence for a few seconds and they said ‘hang on, we’re talking about it’.
“I passed pit entry and I was saying on the radio ‘I’ve passed the entry, I’m staying out’ and then they said ‘yes, we will stay out until the end’.
“At that point I knew I just had to drive as fast and straight as I could with no mistakes and if someone takes wets and gets the win off me then they do.”
Pye added that the tricky conditions and pressure from Whincup made his first win all the more special.
“When your emotions are heightened like that, you’re stressed and in a high-adrenalin moment, when the result is there and you get it, there’s this huge relief,” he said.
“You can finally relax and you’re coming down from a larger high than you normally would in a standard race.
“The first win is always going to be special, but because of that it means even more.”