Quincy Wilson rushed for 135 yards, and the host Mountaineers recovered a blocked punt for a score.
One week after dominating then-No. 3 Virginia Tech, West Virginia couldn't put away the Knights until the fourth quarter.
Brian King intercepted Ryan Schneider on the first drive of the second half and returned it 21 yards to near midfield. The Mountaineers scored in four plays on Travis Garvin's 8-yard run for a 19-3 lead.
A 9-yard punt midway through the quarter put UCF in West Virginia territory for only the second time. Alex Haynes scored from 5 yards, and the two-point conversion made it 19-11.
But Jerry White blocked Mark Prater's punt at the UCF 7 early in the fourth, and Joe Hunter recovered it in the end zone. It was West Virginia's first blocked punt for a touchdown since 1984.