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
Cards' Yadier Molina takes exception to quips by Cubs' Kris Bryant
Cardinals catcher Yadier Molina took exception to quips about St. Louis by Cubs star Kris Bryant and Ryan Dempster, saying only "stupid players and losers" make fun of other cities.
Kris Bryant: 'Not good' that stars Bryce Harper, Manny Machado remain unsigned
Kris Bryant and Evan Longoria expressed frustration that several free agents, including stars Bryce Harper and Manny Machado, are still looking for jobs as February nears.
Buster's Buzz: Red Sox repeat? Four question marks facing the champs
From health to hangovers, Boston still must find a few answers in its quest for a second straight ring.
Yankees sign reliever who criticized Babe Ruth
Mike Golic finds it comical that the Yankees signed reliever Adam Ottavino who previously stated he would "strike out Babe Ruth every time."
Mariano Rivera, Lee Smith and what makes a Hall of Fame closer
One is a first-ballot lock. The other a last-chance inductee. Here's what Cooperstown's 2019 ninth-inning stars tell us about Hall standards for the position.
Angels reach one-year deal with Cody Allen to be closer next season
The Los Angeles Angels have reached an agreement with relief pitcher Cody Allen on a one-year deal to be their closer next season, league sources told ESPN.