Two late quick-strike goals Saturday jolted the Tampa Bay Lightning to victory.

Marty St. Louis and Ondrej Palat scored less than two minutes apart late in the third period to rally Tampa Bay to a 3-2 victory against Buffalo in front of an announced crowd of 18,088 at The Forum.

Tyler Johnson also scored and added an assist, while Ben Bishop made 20 saves to help the Lightning finish a seven-game homestand with a 5-2 record.

“I think we are resilient and that’s nice to see,’’ St. Louis said. “The good teams always find a way to win. It’s not always going to be perfect. We’re not looking for perfection, we’re looking for results.’’

The result against Buffalo was there, but how the Lightning got there was far from perfect even while firing a season-high 39 shots on goal — Tampa Bay was credited with 15 giveaways.

But despite being stonewalled by Buffalo goaltender Ryan Miller for most of the night and falling behind 2-1 on Thomas Vanek’s goal with 7:16 left, the Lightning remained on task and found a way to not only get the goal back, but also find the winning marker in the final six minutes.

Radko Gudas sent a pass from the center point to Steven Stamkos at the left circle. Stamkos then zipped a pass across the ice to St. Louis, who shimmied back into an open spot in the slot for a one-timer just past a sliding Miller at 14:09, which came 83 seconds after the Sabres took the lead.

Two shifts later, Johnson and Palat won the puck in the corner before Palat found Johnson at the top of the crease, but his shot attempt was blocked. That allowed Palat to kick the rebound up to his stick before pushing the puck past a sprawled-out Miller for his second-career game-winning goal with 4:05 to play.

“The big thing on the bench was, they got one and we have to get the next one, and it’s big-time players making big-time plays. ... That pass Stammer makes to Marty,’’ Lightning coach Jon Cooper said. “And then the kids went to work. That was just a 100 percent blue-collar, work-ethic goal and they deserved every ounce of that.’’

For Palat, it was a just reward for a strong, unassuming game in which he did a little bit of everything — from playing solid defense, delivering four hits, protecting the puck on his stick and finishing with four shots on goal to go along with his game-winner to earn top-star billing.