The All-Star closer worked the ninth for his 33rd save, and the Dodgers edged the division-leading Arizona Diamondbacks 3-2 on Friday night.
Los Angeles moved within a game of Arizona, while Colorado dropped 1 1/2 games back after a 7-0 loss in San Diego.
"Every game counts," Jansen said. "That's motivation. That's what fuels me."
Jansen had been shaky since coming off the disabled list, allowing seven earned runs in four innings over four appearances. He was sidelined by an irregular heartbeat.
Helped by pitching coach Rick Honeycutt, he worked out some mechanical issues during a bullpen session in Texas earlier this week. He also watched video of himself from the last two years.
"I feel great," Jansen said. "Just got to figure it out."
"That was huge," teammate Justin Turner said of Jansen. "He looked pretty electric."
Turner homered on Zack Greinke's first pitch of the eighth inning for the go-ahead run in his fourth at-bat against his former teammate.
"Got a slider he left up, one of the few he left up all night," Turner said.
Enrique Hernandez tied it at 2 with a pinch-hit, two-strike, opposite-field homer off Greinke with two out in the seventh.
Dylan Floro (5-3) got the win with one strikeout in one inning of relief.
Greinke (13-9) gave up six hits in 7 1/3 innings. He struck out five and walked one.
"I've been feeling good for the past month at least, maybe longer late in games, to where I've felt like I could pitch a whole other game," Greinke said. "Today was one of those. I felt really good."
Goldschmidt slugged a two-run shot, his team-leading 31st of the season, in the first. Goldschmidt has reached base in 43 straight road games, extending his club record.
Joc Pederson's RBI single in the third left the Dodgers trailing 2-1.
The D-backs had the potential go-ahead run on third base in the eighth. Ketel Marte reached on an error by Floro, got sacrificed to second by Greinke and took third on Floro's wild pitch. But Steven Souza Jr. grounded out to Floro to end the inning.
Diamondbacks: RHP Shelby Miller (right elbow tightness) played long toss with a plan to increase his workload next week. ... OF Jarrod Dyson (right groin strain) was set to have three at-bats in a game with Triple-A Reno on Friday night.
Dodgers: RHP John Axford (right fibula fracture) is off crutches and playing catch in Arizona, but has yet to throw a bullpen or face hitters. ... RHP Ross Stripling (low back inflammation) threw a bullpen and came out of it well. The team has yet to decide on a plan for him.
FREESE IN LA
In the ninth, the Dodgers announced they had acquired third baseman David Freese from the Pirates in exchange for minor league infielder Jesus Manuel Valdez.
"Definitely happy to have him," Turner said. "He's a professional hitter. I love watching him take his at-bats."
Manager Dave Roberts said Freese would be used off the bench against left-handed pitching.
HOT AUGUST NIGHTS
Turner went 2 for 3 and got hit by a pitch. He finished August hitting .402 with 22 runs, 11 doubles, one triple, six homers and 20 RBI in 25 games.
GOLDY VS LA
Goldschmidt's homer was the 31st of his career against the Dodgers, most among active players vs. Los Angeles. He finished 2 for 4 with a double.
Patrick Corbin (10-5, 3.15 ERA) starts for the Diamondbacks against fellow lefty Clayton Kershaw (6-3, 2.39 ERA). Corbin is 1-0 with a 0.98 ERA in three starts against the Dodgers this season. Since the All-Star break, Kershaw is 3-1 with a 1.85 ERA, 46 strikeouts and three walks.
More AP MLB: https://apnews.com/tag/MLB and https://twitter.com/AP-Sports
Marwin Gonzalez hit a two-run homer in a four-run third inning that helped the Houston Astros to a 7-0 win over the Seattle Mariners on Tuesday night.
Corey Kluber throws eight strong innings as he strikes out 11 batters.
Paul DeJong hit a two-run homer, Yadier Molina added a two-run single in a four-run eighth inning and the St. Louis Cardinals won their third straight game with an 8-1 victory over the NL East-leading Atlanta Braves on Tuesday night.
Blake Snell shuts down the Rangers over five scoreless innings, picking up his 200th strikeout and 20th win of the season.
Willy Adames goes deep to center field to give the Rays 2-0 lead in the fourth inning.
Pinch-hitter Ryan Lavarnway drove in the winning run with a single in the 11th inning, Jameson Taillon struck out a career-high 11 and the Pittsburgh Pirates beat the Kansas City Royals 2-1 on Tuesday night.