David Legwand also had a goal and an assist, and Shea Weber added two assists for the Predators, who have earned points in five of six games.
Joe Pavelski and Patrick Marleau scored for San Jose, which has lost two of three.
Nashville returned home from a road trip in which the Predators lost all three games despite going to overtime twice.
The Predators took control against the Sharks by scoring three goals in the second period.
The banged-up Sharks came into Nashville to wrap up their three-game trip, following a shootout win in Chicago on Sunday. The excitement of that win was tempered because forward Logan Couture is set to undergo surgery for what is believed to be a hand injury.
The Predators took a 1-0 lead when Legwand scored his seventh of the season with a wrist shot from the right circle at 3:35.
Ekholm was called for his second delay of game penalty in two games when he put the puck over the glass, and the Sharks took advantage to tie it. Pavelski tipped in a shot from Dan Boyle at 6:49.
Ekholm made up for his penalty just 27 seconds later when he whirled and flipped the puck past goalie Antti Niemi to put Nashville back ahead 2-1.
Sharks coach Todd McLellan wasn’t happy with Nashville’s next goal. Roman Josi, named to Switzerland’s Olympic team on Monday, scored with a wrist shot off an assist from Weber at 11:30.
The puck found the net just after Predators forward Colin Wilson went down in the crease beside Niemi, blocking the goalie. But the goal stood for a 3-1 lead.
San Jose outshot Nashville 11-5 in the third and got within 3-2 when Marleau tipped in a shot from in front past Marek Mazanec at 18:38. The Sharks then took their timeout with 44.5 seconds remaining but couldn’t force overtime.
NOTES: Nashville is 17-0-3 when scoring at least three goals. ... The Predators are 16-1-4 in games they score first. ... The Sharks scratched F Tyler Kennedy (flu). ... Pavelski has scored in nine of 14 games and has 14 points in that stretch. ... The Predators have gotten points in 11 of their last 13 games against San Jose. ... Josi has nine points (4 goals, 5 assists) in his last 15 games.