Middleton scored 10 consecutive points in the final quarter as the Bucks rallied from a nine-point deficit.
Giannis Antetokounmpo scored 26 points and made a crucial block on Suns centre Deandre Ayton to keep the Bucks ahead with one minute 15 seconds left.
The teams meet in the fifth game of the series on Sunday.
“Late in the fourth quarter, we just ran sets that enabled me to get to my spots,” said Middleton.
“After that I’ve just got to make reads. Thankfully, I hit some shots.”
Suns shooting guard Devin Booker scored 42 points, including 18 in the third quarter, but it was not enough to stop the Bucks from sealing a crucial win.
Antetokounmpo, who played down comparison to Michael Jordan after becoming only the sixth player in NBA Finals history to score 40 points in consecutive games, notched 26 points including 14 rebounds for the Bucks, along with eight assists.
However, it was the 26-year-old forward’s sensational block on Ayton that proved the 2020 Defensive Player of the Year’s most telling contribution.
“Just a hustle play,” said Antetokounmpo. “Going down the stretch – do whatever it takes to win the game.
“I saw the play coming. I was there in time, was able to get a good block and go down and get two points.”
The result leaves effectively leaves the series as a best-of-three shootout for the championship.
The Bucks won their only title in 1971, while the Suns have yet to win a title since joining the league in 1968.