Keszthelyi scored six times from nine attempts at goal as the Hungarians, who have finished fourth at the last three Olympic Games, ensured the Rio 2016 silver medallists would not appear in Tokyo.
That came after the Netherlands came from behind to beat Greece 7-4 in the first semi-final to book their place in Japan.
This is the first time the Dutch women have qualified for the Games since they won gold at Beijing 2008.
Netherlands and Hungary take final Tokyo 2020 berths
The Women's Water Polo Olympic Qualification Tournament was the last chance for teams to earn a place at Tokyo 2020 with two nations going through to the 10-team tournament.
The Netherlands were the first team through with a 7-4 semi-final victory over Greece.
They trailed 3-1 at the start of the second period before levelling, but Greece then scored six seconds before half-time to lead 4-3.
Arno Havenga's team showed their class in the second half, scoring four goals without conceding to seal the win with Maud Megens netting twice to take her match tally to three.
Goalkeeper Debby Willemsz, who retired in 2019 but later reversed that decision, excelled as the 2018 European champions made their long-awaited return to the Games.
Player of the match Simone van de Kraats told FINA, "We had to stay calm and we did that. We made the difference in the third and fourth quarters and they (Greece) didn't have time to tie."
"We're so happy that we are finally at the Olympics. It’s amazing, this feeling." - Netherlands' Simone van de Kraats
Hungary took an early lead against Italy thanks to Dorottya Szilagyi and two goals from Keszthelyi.
Roberta Bianconi pulled Italy to within one early in the third period, but they were never able to draw level despite four goals from Claudia Marletta.
Goalkeeping proved to be the difference with Hungary's Alda Magyari saving eight shots out of 18 while Giulia Gorlero could only keep out seven of 20.
Keszthelyi's six-goal haul took her tally to 26 for the week, by far the best in the tournament.
Hungary head coach Attila Biro said, "It was a really tough game. Our goalie was a little bit better than the Italian goalie and I think we had huge mental power. The key was to be calm until the end of the game and push hard in defence."
Tokyo 2020 Women's Water Polo Qualified Teams
The 10-team line-up for the women's water polo tournament at Tokyo 2020 is now complete.
- Japan (hosts)
- United States (2019 FINA World League winners, defending Olympic champions)
- Spain (2019 FINA World Championships runners-up to USA)
- Canada (2019 Pan American Games runners-up to USA)
- Australia (Oceania continental selection)
- South Africa (Africa continental selection)
- Russia (2020 European Championship runners-up to Spain)
- China (2018 Asian Games winners)
- The Netherlands (Olympic Qualification Tournament)
- Hungary (Olympic Qualification Tournament)