Hungary staged a fourth-quarter comeback to force overtime and then outscored Slovakia 13-4 in the extra period to win 85-76.
Anna Vajda had 22 points and 10 rebounds for the Hungarians, who improved to 3-2 while the Slovakians dropped to 2-3 despite 18 points and 11 boards from Lucia Lásková.
The Hungarians were in serious trouble after Lásková made a jump shot at the end of the third quarter for a 63-54 Slovakia advantage.
They were still trailing 72-66 inside the final 1:30 of the game when Hungary's Zsófia Fegyverneky reeled off six straight points - the first four from the free throw line - to tie the contest at 72-72 with 14 seconds remaining.
After both teams failed to score for the reminder of regulation to force the extra period, Fegyverneky again came up big.
The point guard, who had a game-high 24 points, made a lay-up with 2:56 remaining in overtime to start a game-ending 9-0 run for the Hungarians.
The home side made a lot of free throws to win the game. They finished 34 of 40 compared to 16 of 20 for Slovakia.
Zirkova had 20 points to top the scoring for Slovakia.