The 21-year-old scored in the 3-1 win at the Allianz Arena but said his side feared a slip-up when Pierre-Michel Lasogga hit a late goal.
After Mario Mandzukic had opened the scoring at the Allianz Arena just before the break, Gotze doubled the hosts' advantage shortly after halftime only to see Pierre-Michel Lasogga's strike three minutes from the end of normal time set up a tense finale.
Xherdan Shaqiri ultimately sealed the points for Bayern right at the death but, after Bayern threw away a two-goal lead in its midweek Champions League defeat at home to Manchester City, Gotze said his side was feeling uneasy.
"It wasn't easy against Hamburg, who defended very deeply," the attacking midfielder was quoted as saying by the official Bundesliga website. "The opening goal was very important for us. We got a little bit nervous after their goal, but I think we can be pretty pleased with the result."
Bayern now turns its attentions to the FIFA Club World Cup, and Gotze says the squad is buzzing ahead of its trip to Morocco.
"None of us have ever been to the Club World Cup," the Germany international said. "We're looking forward to it and we want to do the best we can at the tournament."