Eric Flato had 13 points and Ross Morin added 12 for the Bulldogs (10-12, 4-4).
Trailing 33-28 with 17:37 left to play, the Quakers went on a 23-1 run, sparked by 10 points from Bernardini, to take a 56-39 lead. During that stretch, Yale missed 10 straight shots and committed five turnovers.
After a layup by Morin, Penn scored four more points, boosting the lead to 61-41 at the 7:52 mark.
The Bulldogs led 26-19 late in the first half, but Grandieri scored six points during a 10-4 run, pulling the Quakers to within 30-29 at the break. Penn had 13 assists to match its 13 field goals in the first half.