Tony Hicks added 18 points for the Quakers (3-10, 1-0 Ivy League).
Pennsylvania led 43-38 at the break and started the second period with three unanswered buckets by Dougherty, Hicks and Nelson-Henry within a minute to stretch its lead to 11.
The Quakers responded with an 11-2 run to lead 71-63 with four minutes left.
Another Barrett 3 with 22 seconds on the clock tied it again before Dougherty and Miles Jackson-Cartwright combined for 3 of 4 from the line to give Penn the win.
The Quakers outrebounded Princeton 42-25.