The Wildcats (8-1) were held to a season-low point total but recorded their eighth straight victory over the Quakers. The outcome was in doubt until Villanova went on a 9-2 run midway through the second half to extend a 40-34 lead to 49-36.
Stokes scored seven of those points, including a 3-pointer with 8:40 left to reach 1,000 for his career.
The Quakers (4-4), who saw a two-game winning streak snapped, did not get closer than seven points the rest of the way.
Junior guard Zack Rosen paced Penn with 20 points and five assists.
Stokes shot 11 for 15 from the field, including going 5 of 9 from 3-point range.
Antonio Pena added 16 points and eight rebounds for the Wildcats, who won their second straight since suffering their only loss of the season, to No. 11 Tennessee in the NIT Season Tip-Off.
Senior guard Corey Fisher, Villanova's leading scorer, did not start for disciplinary reasons, though he was inserted 2:15 into the game. A university spokesman said Fisher had had a disagreement in practice.
Fisher, averaging 15.6 points through the team's first eight games, finished with four points on 1-for-6 shooting. He had six assists.
The Wildcats lost sophomore guard Maalik Wayns, their third-leading scorer, when he hit his head while drawing a charging foul with 1:22 left in the first half. He did not play the rest of the game.
Stokes scored six points as Villanova opened a 12-4 lead, but Penn answered with a 13-4 flurry to take its only lead of the game, 17-16, on a fastbreak layup by freshman guard Miles Cartwright with 8:33 left in the first half.
Wayns scored his only basket of the game 10 seconds later to put the Wildcats back in front. They never trailed again, but neither could they shake the Quakers, who were down 30-23 at halftime and on three occasions cut the deficit to six points in the opening minutes of the second half.