On the go-ahead goal, Theodore's shot deflected off Calgary's Andrew Mangiapane's stick and past Rittich into the top corner for his 12th. The Flames tied the score earlier in the third period after trailing 3-0 in the second.
''That was big,'' Theodore said. ''When a team ties it up late, if anything you don't want to give anybody in the division points. It was a lucky play, but it was a big play. Sometimes you just throw it to the net and good things happen.''
Nick Holden had a goal and an assist for the Golden Knights, who regained top spot in the Pacific Division over idle Edmonton. Tomas Nosek, Max Pacioretty and Jonathan Marchessault also scored for Vegas.
''Points are so tight this time of year, especially with a back-to-back here and then Edmonton (Monday) night,'' Theodore said. ''I think getting some confidence from tonight and building off that is going to be key going down the stretch.''
Making his third start for Vegas since being acquired from Chicago at the trade deadline, Robin Lehner made 19 saves to improve to 3-0-0 with his new team.
''I'm still adjusting a little bit,'' said Lehner, who improved to 3-0 with his new team. ''It was a big two points and we've got to keep building. We battled hard and didn't give them too many chances. They got a break (on the tying goal) and made a pretty good play. It was big, but I thought we played to our structure and battled hard.''
Marchessault capped the scoring with an empty-netter with 18 seconds left for his 21st.
Milan Lucic had a goal and an assist for the Flames, who had won three straight. Dillon Dube and Matthew Tkachuk also scored for Calgary. David Rittich had 27 saves to fall to 0-6-1 in his last seven home starts.
''Up until the last few minutes of the game, we did exactly what we needed to do,'' Lucic said. ''It's just a tough tip off our own stick right underneath the bar. I mean, he shoots that 100 times, I guarantee you it's not going in 99 out of 100, so it's just a tough one after working ourselves back into the game after being down 3-0.''
Trailing 3-0, Lucic got the Flames on the scoreboard as he snapped a shot through Lehner's legs at 8:23 of the second period. It was his eighth.
Dube pulled Calgary within one 8:09 later as he beat Lehner over his blocker on the power play for his sixth.
Tkachuk tied it with 3 minutes remaining in regulation when he took a pass from Mangiapane before lifting a backhand shot past Lehner.
''We battled back from their lead and I think did some good things tonight, so we've got to build on that,'' Dube said. ''There's no time to dwell at this time of the year with how tight it is.''
Nosek opened the scoring at 5:24 of the first period when he deposited a rebound past Rittich, who stopped the initial shot by Ryan Reaves but couldn't get back into position in his net to deny the follow-up attempt.
Vegas then went up 2-0 at 11:49 when Holden took a pass from Nick Cousins and snapped a quick shot past Rittich.
Calgary appeared to pull within one with a little more than four minutes to go in the opening period when Mikael Backlund swatted a rebound past Lehner, but the goal was disallowed after replays showed Backlund interfered with the goalie before scoring.
''After we had that disallowed interference goal, we stared to get on the forecheck, started to get on the body and started winning more puck battles and I felt that's what we weren't doing in the first 15 minutes of the game,'' Lucic said.
Pacioretty put the Golden Knights up 3-0 with a power-play goal at 3:39 of the second when he one-timed a pass from William Karlsson past Rittich.
NOTES: Knights F Mark Stone missed his fifth game in a row with a lower-body injury, while his older brother and Flames defenseman Michael Stone sat out his sixth straight contest as a healthy scratch. ... After sitting out the past eight outings for the Flames as a healthy scratch, Zac Rinaldo drew back into Calgary's lineup in place of fellow forward Tobias Rieder, who had suited up for 10 straight games. ... After being involved in a collision in his own zone early in the first period, Flames D Noah Hanifin left the ice with an upper-body injury and didn't return.
Golden Knights: At Edmonton on Monday night.
Flames: Host the New York Islanders on Thursday night.
Copyright 2020 by STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.