A 74th-minute try from All Blacks lock Patrick Tuipulotu gave the Blues their first victory over New Zealand opposition since they beat the Highlanders in the opening round of the 2016 Super Rugby campaign.
The lead changed hands regularly throughout a tight contest at Eden Park, with a yellow card for Highlanders winger Waisake Naholo for a dangerous tackle in the 68th minute when his side were ahead 26-23 proving decisive.
Tuipulotu forced his way across the line from close range and his fellow replacement Otere Black converted before adding a penalty two minutes from time as the Blues snapped a 20-match losing streak against their compatriot teams.
All Blacks winger Rieko Ioane scored two brilliant tries in the first half and fullback Melani Nanai added a third after the break to help cancel out scores from Highlanders number eight Luke Whitelock and winger Tevita Li.