"We played a pretty solid game (but) we missed some opportunities to get a two-goal lead," said Lecavalier. "It definitely could have gone either way tonight."
Richards scored on New York's first shot of overtime after Michael Del Zotto took the puck from a Lightning player on the right side and passed to Artem Anisimov in the slot.
Anisimov slid a pass low to Richards on the right side, who slapped the puck in as he fell to the ice.
"Overtime winners are special no matter what," said Richards, who played for the Lightning from 2000-08. "And getting one against your former team ... put all those things together and it's a lot of fun."
Earlier, Boyle tied the game midway through the third period on a quick shot from the left side.
The Rangers were coming off a 1-0 loss to Martin Brodeur and the Devils on Tuesday, which ended in controversy when a potential game-tying goal with 3.5 seconds left was waived off because Marian Gaborik crashed into the net and was called for interference, although it appeared he had been pushed.
They have 73 points, leading the Atlantic Division and the Eastern Conference, but had to come back after giving up a 2-1 lead.
Stamkos scored the only goal of the first period, skating in behind two defensemen and sneaking a backhand past Biron with 64 seconds left to give the Lightning a 1-0 lead.
Callahan's power play goal on a tipped shot and Stepan's spinning shot off his own rebound in the slot made it 2-1 Rangers 5:27 into the second period. But Lecavalier scored just 21 seconds later and Gervais made it 3-2 on a power play at the 12:26 mark.
Lecavalier banked a shot in off a Rangers player who was in the crease behind Biron, and Gervais was left wide open in the slot for a wrister.
The Rangers have won two of their three meetings this season, but Tampa Bay is 5-2 in the last seven...New York went 2-1 on a three-game homestand and will play at Philadelphia on Saturday...Tampa Bay started a three-game road trip that wraps up with games in Buffalo and Pittsburgh on Saturday and Sunday, respectively.