Nene (11 points, six rebounds, five assists) and the Wizards snap a four-game losing streak at the Palace of Auburn Hills. (Tim Fuller/USA Today Sports)

Late in the fourth quarter of the Washington Wizards106-99 victory over the Detroit Pistons, a heckler behind the Wizards’ bench shouted, “Let Wall shoot. He can’t shoot it.”

John Wall walked away, lifting his jersey to wipe the sweat from his nose and acting as if he didn’t hear the man. He then turned around, spotted him and winked in his direction. A few minutes later, Wall made sure similar comments would not be made for the rest of the night.

With the Wizards holding on to a four-point lead in the final minute, Wall dribbled right, pumped to get Pistons guard Brandon Jennings off his feet, then pulled up for a fallaway jumper. A stunned Jennings stared at Wall as the shot went through the net — and Wall winked at Jennings, too, before beating his chest, hooting then jumping into his teammates along the bench.

“I heard that,” Wall said of the fan after scoring a game-high 29 points to reach at least 20 for the seventh consecutive game. “I love it. Everybody tells me I can’t shoot, but I’m just proving myself, just trying to keep winning basketball games.”

Wall’s jumper ensured the Wizards (14-14) are back at .500 for the second time this season. They will enter the new year without a losing record for the first time since 2008, when the franchise’s last playoff team started the calendar year at 15-14.

Wall also shot 14 for 15 from the foul line and added seven assists as the Wizards rallied from a 12-point deficit late in the third quarter to defeat the Pistons for the second time in three days. Five players scored in double figures, with Trevor Ariza adding 15 points, 11 rebounds and six steals. Washington also got 35 points from its bench, which went on a 14-0 run in just four minutes to set the stage for starters to snap the Wizards’ four-game losing streak at the Palace of Auburn Hills.

“We played with heart and played simple,” Martell Webster said after the Wizards won for the fifth time in six games, with four coming on the road. “You can do all the drills you want to play defense, but at the end of the day, it all relies on how much heart you have.”

The Wizards didn’t think that they would be able to duplicate their performance from two nights before, when they used a physical, grinding style to throttle the Pistons and claim their largest margin of victory in a 106-82 home win. They fully expected the Pistons would provide much more of a fight, especially with their physically imposing front court of former Georgetown star Greg Monroe, Andre Drummond and Josh Smith. Jennings was also smarting after Wall helped force him into seven turnovers.

Detroit had just 11 offensive rebounds in the previous meeting but had 14 in the first half, giving the Pistons a decided edge in second-chance points at 20-2. Pistons rookie Kentavious Caldwell-Pope set a career high with 17 points, all in the first half, and gave his team a 63-51 lead late in the second quarter with his third three-pointer.

“Games like these are hard, especially the way we won the one back in D.C. We knew these guys were going to come out and really get after us,” Coach Randy Wittman said. “We were not playing the way you have to against their bigs. We were flopping. We were complaining to the referees. We were looking for fouls, and I told them at halftime, ‘That’s not how we played the game in D.C. We didn’t care if the ref called a foul, didn’t call a foul for us or against us.’ I said, ‘Let’s do that this half and see what happens.’ ”

Beal missed his first four shots and had three turnovers early on, but after scoring just two points in the first half, Beal eventually settled down and had nine of his 13 points in the third period. He drilled a three-pointer off the glass to bring the Wizards within 68-64, but the Pistons went on another run and led by 11 when Jennings (15 points, 14 assists) stole a bad pass by Ariza, then pulled up for a three-pointer. The Pistons led 87-75 when Smith made a layup, but Nene made a jumper and a free throw to put his team within range at the start of fourth.

Kevin Seraphin, who missed the previous two games with a sore right knee, returned and provided a huge boost offensively, scoring four points during the rally, and rookie Otto Porter Jr. (career-high seven points) made a jumper to bring the Wizards within one. Martell Webster (10 points) put them ahead 89-87 with a three-pointer that brought his teammates out of their seats.

“Our second unit was the big difference,” Wittman said.

Nene (11 points) threw down a ferocious dunk to give the Wizards the lead for the good, but they would need a few more big plays to finish. Beal coolly hit a long jumper to put them ahead 99-96, then Nene hit a foul line jumper to extend the lead to five.

Marcin Gortat had a difficult night, collecting a technical foul when he complained about getting called for a foul on Monroe, who led the Pistons with 22 points. But he came through with a huge block in the final minute, meeting Smith, a former slam dunk champion, at the rim to block a dunk.

“I was so frustrated during this game, I didn’t have anything to lose,” Gortat said. “Finish the game with two rebounds and get dunked on or not getting dunked on, it doesn’t matter to me. That’s my responsibility, and I was glad I was able to help at least on that one possession. I’m glad we ended up getting the ball.”

On the next possession, Wall showed how much his jumper — and his team — has improved.