Federer, who has now won the Wimbledon warm-up event on grass six times, needed to dig deep for his 77th career title and extend his head-to-head with Youzhny to an impressive 15-0.
The 31-year-old won three break points in the first game but Youzhny's powerful serve got the world number 29 out of early trouble.
The Russian, who defeated three seeded players en route to the final, held serve and matched Federer's skill on grass with hammering groundstrokes.
Federer, who has now beaten Youzhny five times at Halle since 2002, saved a set point at 5-6 but conceded another in the tiebreak for the Russian to take the lead with a well-placed volley.
Federer refused to buckle and finally got his first break when Youzhny double-faulted for 5-3 before he served out the second set.
The Swiss patiently waited for his next break opportunity and got it after a sizzling exchange of groundstrokes, Federer going 4-3 up and holding serve to clinch his maiden 2013 title after two hours and two minutes.