Fullback Israel Folau scored his 11th try of the season as the New South Wales Waratahs beat the Chiefs 33-17, likely ending the Chiefs' two-year reign as Super Rugby champions.
The Chiefs had the first lead of the match at 3-0 with a penalty to returning All Blacks flyhalf Aaron Cruden but Foley tied the scores with his first penalty only seven minutes later.
The Waratahs had a try disallowed when winger Alofa Alofa combined with scrumhalf Nick Phipps on the blindside but the referees detected an earlier obstruction.
Folau's try in the 15th minute was also submitted to the scrutiny of the video referee before being confirmed.
The Wallabies fullback's 11th try of the season surpassed the Waratahs record previously held by winger Peter Hewat.
The Waratahs led 13-3 at halftime but the Chiefs rushed back into the match with tries to Aki in the 55th and 62nd minutes, both from kick chases.
On the first occasion, Cruden put the kick-through that Aki contested in-goal with teammate Tim Nanai Williams. On the second, the kick was provided by fullback Tom Marshall.
Captain's decisive try
The Waratahs continued to hold the ball through a long sequence of phases and they were rewarded with Dennis's dashing try in the 72nd minute.
Foley then completed the rare cross-Tasman win by scoring and converting his own try on the fulltime siren.
"It's been a couple of years since we had a win over here but we were really keen to put in a strong performance tonight," Waratahs captain Dave Dennis said.
The win lifted the Waratahs to second place on the championships table, leaving them atop the Australian conference, while the Chiefs remained anchored in eighth place.
The Waratahs had lost their last eight games in New Zealand - a streak spanning four years - but turned that around with a win which kept them strongly in contention for a home semi-final.