The Hornets won their second in a row and drew closer to a playoff spot, moving 11 games above .500.
Phoenix led for much of the game but was outscored by 11 points in the fourth period.
Okafor grabbed an offensive rebound off a miss by Willie Green and his key basket gave the Hornets a 104-100 advantage. After Steve Nash turned the ball over for the Suns, Green clinched the contest on a layup with 16 seconds to play.
Chris Paul led New Orleans with 22 points and Carl Landry had 17. The Hornets learned Friday they will play the rest of the season without David West, who suffered a torn knee ligament on Thursday in a win over Utah.
Grant Hill scored 18 points for Phoenix.