The German led 5-2 in the second set but dropped serve.
He then wasted two match points on Berlocq's serve before using his fourth to close out the encounter, hitting a cross-court forehand winner. Berlocq won his maiden title in Bastad, Sweden, last week.
Juan Monaco, the fifth-seeded Argentine who beat Haas for the Hamburg title last year, defeated ninth-seeded Benoit Paire of France 6-3, 2-6, 6-2.
Haas next plays Fabio Fognini of Italy, who beat Marcel Granollers of Spain 6-2, 6-4. Fognini won his first title last week in Stuttgart.
Monaco plays third-seeded Nicolas Almagro, who beat Guillermo Garcia-Lopez 6-2, 6-3.
Meanwhile top-seeded Roger Federer cruised past Czech qualifier Jan Hajek 6-4,
6-3 to book his quarters spot.
The four-time Hamburg champion is playing his first tournament since losing in the second round of Wimbledon.
Federer used only three of 13 break points and needed six match points to close out the match.
He produced a spectacular overhead smash winner with a flick of the wrist while stepping back in the final game.
Results from the ATP Hamburg tournament (x denotes seeding):
Third round:
Florian Mayer (GER) bt Feliciano Lopez (ESP x11) 7-6(7/1), 6-2
Roger Federer (SUI x1) bt Jan Hajek (CZE) 6-4, 6-3
Tommy Haas (GER x2) bt Carlos Berlocq (ARG) 6-2, 6-4
Fernando Verdasco (ESP x14) bt Jerzy Janowicz (POL x4) 7-5, 4-0 - retired
Juan Monaco (ARG x5) bt Benoit Paire (FRA x9) 6-3, 2-6, 6-2
Nicolas Almagro (ESP x3) bt Guillermo Garcia-Lopez (ESP) 6-2, 6-3
Fabio Fognini (ITA x12) bt Marcel Granollers (ESP) 6-2, 6-4
Federico Delbonis (ARG) bt Dmitry Tursunov (RUS) 6-4, 6-3