Gilbert completed Friday's 201-kilometre event — 16 laps of a demanding 12.6 kilometre trek through Old Quebec — in 5:03:06 under a hot sun.
Gilbert, a 29-year-old classics specialist with Omega Pharma-Lotto, posted his 17th win of the season and took over first place on the World Tour circuit, passing Cadel Evans.
Robert Gesink (Radobank) finished second, while Rigoberto Uran (Sky) came in third.
Gilbert said afterward it was "a very difficult race."
"It was tough to resist Gesink, who was just behind. He was very focused on getting back at me but I managed. At 700 metres, I went ahead a little, at 500 metres, I accelerated again and in the last 100 metres I used my advantage.
"It was a beautiful moment."
He told reporters at a post-race news conference that 2011 was an "outstanding" season for him.
"To finish the season with a win and No. 1 in the world ranking is the icing on the cake."
The Belgian wasn't shy about relishing in his victory or knocking his teammates.
"This is a special victory because it's the first time I didn't have a team to help me," he said. "We had a very weak team today. I was stressed during the race because I was almost always alone, especially in the final."
He predicted that he'll feel less pressure in Montreal on Sunday.
The Grand Prix Cycliste is a two-race event being held in Quebec City and Montreal for a second year as part of the World Tour.
The Montreal race will be held on Sunday. Gesink won it last year.
Toronto's Michael Barry, Uran's Sky teammate, had the best local result with 14th place and a time of 1:23.
"I'm happy with my result," he said. "I had a better race than last year. I had less trouble but the end was hard."
Victoria's Ryder Hesjedal, who finished fourth in the first edition of the event in 2010, found himself far behind the group leaders at the end of the race.Suggest a correction