Zdeno Chara and Josh Bailey scored for the Islanders (37-35-10), who will miss the playoffs for the first time since 2018. Ilya Sorokin made 28 saves.
"Obviously we didn't have the third period that we wanted," Islanders coach Barry Trotz said. "I think we stopped moving the puck. We stopped skating and I think we got a little stunned by their power play and how that puck was moving."
Corey Perry scored a power-play goal to make it 3-2 at 1:21 of the third period. Ryan McDonagh tied it 3-3 at 10:10.
"I think we kind of simplified things a little bit in the O-zone," McDonagh said. "We shot a lot of pucks and just created some chaos. Keep some sustained pressure in there by just putting pucks down to the net. In the end, we clawed our way back into it and found a way."
Stamkos gave Tampa Bay a 4-3 lead with a shot from the slot at 11:13 and completed his 10th NHL hat trick at 17:50 to make it 5-3.
"We skated and we pressured and we forechecked, I thought we got away from that in the second period," Stamkos said. "If we're engaged physically and using our speed, we create turnovers and we can create some scrambles in the offensive zone."