NEW YORK — Pound it into the paint, pound your opponent on the backboards.

The Memphis Grizzlies rediscovered their winning formula Saturday, getting 25 points and 15 rebounds from Zach Randolph, and snapping a five-game losing streak with a 95-87 victory against the New York Knicks.

Tony Allen added 19 points and eight boards while providing his usual strong defense. Jerryd Bayless scored 11 points, including two free throws to end a Knicks flurry that had trimmed a 19-point deficit to four in the final half-minute.

“This was going to be a tough one. It is not easy winning here,” point guard Mike Conley said. “For us to come in and win says a lot. Hopefully this will spark something for us.”

Conley finished with nine points and eight assists after missing two games with a bruised left thigh for the Grizzlies, who had a 56-29 rebounding advantage and outscored the Knicks 60-28 in the paint.

“That’s embarrassing, especially when you start a big lineup,” Knicks Coach Mike Woodson said, adding that Carmelo Anthony, Tyson Chandler and Andrea Bargnani needed to rebound better.

“I thought that was the difference.”

Anthony scored 30 points, while reserves J.R. Smith and Tim Hardaway Jr. each had 16 for the Knicks.

Chandler had eight points and six rebounds in his second game back from a broken leg, while Bargnani managed just three points and two boards in 22 minutes after moving back into the starting lineup.

Randolph and the Grizzlies front line outworked the Knicks, methodically increasing their lead until they were able to build a big cushion with a 15-5 run that spanned the end of the third quarter and early fourth.

“It was real critical me being aggressive, getting to the free throw line, making shots. Something I’ve been trying to do these last couple of games,” Randolph said. “Been a lot of focus on me packing the paint. I was kind of hoping that I could operate down there.”

Randolph had 10 points and eight rebounds in the third quarter, including a follow shot for the first of three straight Memphis baskets that turned an eight-point lead into a 72-58 advantage. He made two free throws to open the fourth, then Bayless had the next three field goals for the Grizzlies to push the lead to 81-63.

Memphis seemed comfortably ahead after Randolph scored in the lane and Allen came up with a steal and basket to make it 91-78 with 3:04 to play, but Smith and Anthony made consecutive 3-pointers to start a run of nine straight Knicks points that made it 91-87 with 25 seconds remaining.

Bayless than knocked down a pair of free throws and Allen closed it out with a final basket.

“I thought that we played really, really hard,” Memphis Coach Dave Joerger said. “Every coach puts up on his board, ‘play hard, play smart, play together.’ I thought just about every single minute of the game we played hard.”

The Knicks fell to 4-10 at home, matching their total number of home losses all of last season in 41 games.

NOTES

NETS: Center Brook Lopez broke a bone in his right foot again, leaving the struggling team without its leading scorer.

Lopez was hurt during Friday’s loss at Philadelphia. The Nets said they will issue another update next week after consultation with their doctors.

BOBCATS: Small forward Jeffery Taylor will miss the rest of the season because of a ruptured right Achilles tendon.

Taylor was injured in the first half of Friday night’s game against Detroit.