The Cougars' lead was 80-76 after Dowell hit the front end of a two-shot foul with 2:19 left. But East Carolina rallied to regain the lead on back-to-back 3-pointers by James Legan, the last of which came at 1:45. Smith hit the front end of another two-shot foul to cut the Pirates' lead to 82-81 with 1:20 left.
Robert McKiver, who was 11-for-14 from the free throw line, hit two of his foul shots with 44 seconds to go to put Houston on top again.
Kelvin Lewis fouled Farmer with 22 seconds to go to set up his game-winning free throws. Houston worked for the last shot, but McKiver missed a jumper with 3 seconds left.
Sam Hinnant led the Pirates with 30 points, including 8-for-16 from 3-point range. Farmer finished with 13, and Legan and John Fields had 10 apiece for East Carolina. Fields also grabbed 10 rebounds.
McKiver had 29 despite 7-for-22 shooting. Lewis had 19 and Dowell scored 17.