Oosthuizen started the round with a two-stroke lead, but racked up a pair of double-bogeys on the front nine. That provided an opening for Mahan, who used a steady approach to finish at 16-under-par 272.
It was the fifth career PGA Tour title for Mahan, who became golf's first multiple winner this year following his February triumph at the WGC-Accenture Match Play championship.
Carl Pettersson also fired a 71 to nail down second place at minus-15, while Oosthuizen stumbled to a 3-over 75 and settled for third at 14-under 274.
Defending Houston champ Phil Mickelson finished in a fourth-place tie at minus-12 after carding a 71.