This was RCB's fifth win in six matches and put them back on top of the points table after a huge loss to Chennai Super Kings (CSK) in their previous match had displaced them from the top spot.
DC, who are third after their second loss in six games, had their backs to the wall at 92 for four in 12.4 overs. However, Hetmyer turned it on and added 78 runs in 44 balls with skipper Rishabh Pant (58 not out off 48 balls) to take the team within striking distance of victory.
Needing 46 from 18 balls, Hetmyer scored 20 out of 21 runs in the 17th over bowled by Kyle Jamieson (who bowled the 18th) to bring the equation down to 25 off two overs. Harshal Patel conceded 11 and Mohammed Siraj conceded 12 to win the game for RCB.
Siraj began the last over well, bowling a couple of yorkers to Pant. However, he conceded two boundaries on the last two balls. That left DC still one run short.
Earlier, India pace bowler Ishant Sharma took one for 26 in his first match of the season for DC but it was AB de Villiers (75 not out) who drove RCB to 171/5.
De Villiers's unbeaten 75 came off 42 deliveries and comprised three fours and five sixes as he took 23 runs (including one wide) in the last over of the match bowled by Marcus Stoinis.
DC had done well to pick two early wickets, removing both Devdutt Padikkal (17) and skipper Virat Kohli (12) inside the powerplay.
While Padikkal was bowled by Sharma, Kohli was bowled by Avesh. Glenn Maxwell (25) fell soon after, leaving RCB at 60 for three.
However, de Villiers shared a 54-run partnership with No. 3 Rajat Patidar (31 off 22 balls) and took the charge to the opposition in the end overs. RCB were looking like they would struggle to get past 160 at 124/4 in 16 overs. But the last four overs produced 47 runs.
Brief scores: Royal Challengers Bangalore 171/5 in 20 overs (AB de Villiers 75 not out, R Patidar 31, G Maxwell 25; A Khan 1/24, I Sharma 1/26, A Mishra 1/27) vs Delhi Capitals 170/4 in 20 overs (R Pant 58 not out, S Hetmyer 53 not out; H Patel 2/37, K Jamieson 1/32, M Siraj 1/44