Pegula put pressure on Halep's serve at the outset of the match and wrapped up the 35-minute first set with an ace.
But a loose service game early in the second set, capped by an unforced backhand error, gave the two-time Grand Slam champion a 3-1 lead as frustration began to mount in her less experienced opponent.
Halep broke at love for a 3-2 lead in the third set and hung on to claim her 37th victory of the year despite producing 10 double faults and putting less than 60% of her first serves into play.
The Romanian is set to face Haddad Maia, who defeated Karolina Pliskova 6-4 7-6, in Sunday's final.