The Waratahs scored a 78th-minute try to beat the Brumbies 21-17 in Wagga Wagga on Saturday.
The Tahs trailed by 10 points at the end of the third quarter of this pre-season match, but hit back with a converted try by replacement back Bryce Hegarty.
Replacement lock Senio Toleafoa then scored with two minutes to go to snatch victory.
The Brumbies opened the scoring after 10 minutes when hooker Josh Mann-Rea scored an unconverted try from a rolling maul.
After failing to score from their own lineout maul in the 18th minute, the Waratahs were rewarded for their pressure as inside centre David Horwitz went over in the corner to make it 7-5.
The Brumbies, though, finished the half strongly when loosehead prop Allan Alaalatoa scored to give his side a 12-7 lead at the break.
The hosts went further in front when loose forward Michael Wells scored their third try with 20 minutes to go, but the Tahs would respond with two tries to secure the win.
Waratahs – Tries: David Horwitz, Bryce Hegarty, Senio Toleafoa. Conversions: Andrew Deegan, Bryce Hegarty (2).
Brumbies – Tries: Josh Mann-Rea, Allan Alaalatoa, Michael Wells. Conversion: Matt Toomua.
Waratahs – 15 Zac Guildford, 14 Reece Robinson, 13 Matt Carraro, 12 David Horwitz, 11 Andrew Kellaway, 10 Andrew Deegan, 9 Jake Gordon, 8 Jed Holloway, 7 Jack Dempsey, 6 David Dennis (c), 5 Will Skelton, 4 Ned Hanigan, 3 Paddy Ryan, 2 Hugh Roach, 1 Jeremy Tilse.
Subs: Tolu Latu, Benn Robinson, Angus Ta’avao, Matt Sandell, Senio Toleafoa, Matt Lucas, Harry Jones, Bryce Hegarty, Brad Wilkin, Cameron Orr, Rowan Perry.
Brumbies – 15 Aidan Toua, 14 Lausii Taliauli, 13 Andrew Smith, 12 Jordan Jackson-Hope, 11 Nigel Ah Wong, 10 Matt Toomua, 9 Tomás Cubelli, 8 Ita Vaea, 7 Jarrad Butler, 6 Jordan Smiler, 5 Sam Carter, 4 Tom Staniforth, 3 Ben Alexander, 2 Josh Mann-Rea, 1 Allan Alaalatoa.
Subs: Albert Anae, Robbie Abel, Leslie Leuluai’ali’i-Makin, Ruan Smith, Rory Arnold, Blake Enever, Ben Hyne, Michael Wells, Joe Powell, Michael Dowsett, Nick Jooste, Joe Tomane, Jake Rakic, Tevita Kuridrani, James Dargaville, Isaac Thompson.