The pair finished the final stage of the race together on Sunday, one minute and two seconds behind Hugh Carthy's solo breakaway on snow-lined roads.
Dennis tried to attack at the Furkapass but was unable to shake the Team INEOS rider.
“I really didn’t expect to come here and get second overall," Dennis explained. "Moreover, a stage win and with Egan Bernal on the front on the queen stage, taking a second place, was more than I’ve planned to do. But I have to say that lot of work was done behind the scenes and even today.
"Today the team worked together with Ineos and it looked like we were working with them, but we had a plan to try to take the win today and do everything was possible to do. But unfortunately, Bernal was too strong this week. Anyway, taking second overall, we can be really proud of that."
The Colombian came to Switzerland to support team leader Geraint Thomas, the 2018 Tour de France champion, who crashed out in a nasty fall on Tuesday.
Thomas' accident followed teammate and four-time Tour de France winner Chris Froome suffering season-ending injuries in a training crash in France.
Bernal is expected to start the Tour de France on July 6 as Thomas' top aide, but this victory proves his own race-winning ability on top of his Paris-Nice victory in March.