Devon Goodman had 19 points for Penn and Ryan Betley added 14 points and 10 rebounds.
Goodman hit two free throws to give the Quakers (4-2) a 68-65 lead with 27 seconds left. UCF missed three shots on its ensuing possession and a tie up gave Penn the ball with 3.4 seconds remaining, but an errant inbound pass gave it back to the Knights. Darin Green Jr. then hit what was originally called the tying 3-pointer at the buzzer but, after replay review, it was called a 2 and the Quakers escaped with the win.
Penn with play the winner between No. 14 Arizona and Pepperdine in the semifinals, and the Knights will take on the loser in the consolation bracket, on Friday.