Colin McDonald and Michael Del Zotto also scored for Philadelphia, which won for just the fourth time in 16 games.
The Flyers gave up the tying goal to Michael Fisher with 20 seconds left in regulation. Philadelphia went on the power play when Nashville was called for too many men on the ice.
Gostisbehere one-timed Claude Giroux's pass from the slot past Pekka Rinne for his third goal of the season and second straight winning goal in overtime. Gostisbehere scored 24 seconds into the extra session Monday in Philadelphia's 3-2 home win over Carolina.
Filip Forsberg also scored for Nashville.