The final score wasn't as close as it looks. Lecavalier, fittingly, scored a power-play goal with 1 minute, 53 seconds left to get the Flyers to within 3-1. Streit, with goalie Ray Emery pulled, made it 3-2 with 1:13 remaining.
But the Lightning secured the win on Tyler Johnson's empty-net goal with 33 seconds to go.
"We should have gotten this for Vinny," said Wayne Simmonds, who failed to score on a penalty shot in the first period. "We wanted to get that win for him, but we didn't play to the best of our ability."
Lecavalier said he was "disappointed" with the outcome but overcome with gratitude for the welcome given by Lightning fans.
Tampa Bay (16-8-1) was playing without five injured regulars, including star center Steven Stamkos. The Lightning are 4-3-1 since Stamkos suffered a broken leg.
Hedman gave the Lightning a 3-0 lead by scoring on a backhander from the slot while Tampa Bay was on a five-on-three power play with 15 minutes remaining.
Until their late flurry, the Flyers had virtually no pressure on backup goalie Anders Lindback (19 saves), who entered the night 1-5 with a 3.47 goals-against average and a .872 save percentage.
Lindback was rarely tested in the first two periods as the Flyers, looking like the team that started the season 1-7, managed just 12 shots.
Tampa Bay snapped a scoreless tie by getting second-period goals from Hedman (a bad-angle shot to the short side) and Ondrej Palat. Palat scored a shorthanded goal as he deposited a rebound after the Lightning blocked a shot at the other end and went on a two-on-one.
For Lecavalier, it was his first game at the Tampa Bay Times Forum since the Lightning bought out his contract and he signed with the Flyers last summer. Lecavalier spent 14 years in Tampa Bay, where he is revered for his hockey talent and his off-ice philanthropy.
There were two video tributes to Lecavalier during the first period, including one that showed him visiting children at the pediatric cancer center that his foundation built. From the bench, Lecavalier waved to the crowd, which gave him two standing ovations during the night, and players from both sides tapped their sticks on the ice or bench to show their respect.
Even the officials were clapping.
Emery was outstanding before allowing Hedman's first goal from a difficult angle midway through the second period. Emery made 23 saves in the first two periods.
In his last four appearances before Wednesday, Emery had a 1.01 goals-against average and a .960 save percentage.
Tampa Bay dominated the opening period and had a 14-7 shots advantage. The Flyers missed the period's best scoring chance when Simmonds was stopped by Lindback on a penalty shot with 3:14 left in the first.
That made the Flyers 0 for 3 on penalty shots this season - two attempts by Simmonds, one by Adam Hall - and 19 for 49 (38.8 percent) in franchise history.
Matt Read missed the game with a lower-body injury that is not believed to be serious. He is listed as day-to-day. . . . Michael Raffl replaced Read after being scratched the previous seven games, and he was on a line with Sean Couturier and Steve Downie.