When Keith Bogans took the ball out of bounds with 5.2 seconds left in overtime and the score tied at 111, everyone in the building knew Joe Johnson would wind up with the ball.

It didn’t matter.

Johnson saved the Nets for the second time last night, following up his game-tying 3-pointer at the end of regulation with a buzzer-beating jumper over the outstretched arms of Milwaukee’s Luc Mbah a Moute in a wild 113-111 victory over the Bucks in front of 17,334 inside Barclays Center.

“I hate to do the comparison to Michael Jordan,” Gerald Wallace said with a big smile and a laugh, “but like everybody knew Michael was getting the ball in Chicago for the last-second shot, everybody in the arena knew Joe was getting the ball.

“We could have put him out there by himself — well, with somebody to take the ball out — but he just makes plays.”

After the Bucks had used their final foul to give with 5.2 seconds left in overtime, Johnson took the inbounds pass from Bogans and squared up against Mbah a Moute, Milwaukee’s best wing defender, at the top of the key. Johnson backed him down, got just enough space and rose up to drain the game-winning basket as time expired, sending the home crowd into a frenzy. Johnson had delivered game-winning shots against the Pistons, Wizards and Knicks earlier this season.

“[Nets interim coach P.J. Carlesimo] just drew a play up and told me to go get a bucket,” said Johnson, who finished with 24 points, five rebounds and five assists. He’s now 8-for-9 shooting this season in the final 30 seconds of games when the Nets are within three points of their opponents.

But it was only thanks to Johnson’s equally dramatic shot at the end of regulation that he even had a chance to win the game in the extra session. After Deron Williams had been called for an offensive foul for catching Monta Ellis with an elbow with less than 10 seconds remaining in the fourth and the Nets trailing 103-102, Bucks point guard Brandon Jennings — who finished a sensational night with 34 points, six rebounds and seven assists — hit a pair of free throws with 6.7 seconds remaining to give Milwaukee a 105-102 lead.