You only need to have the intention to LIVE outside Quebec, which means that you are allowed to work anywhere in Canada (ex. reside in Ottawa and working in Gatineau QC), even you can apply for PR from Quebec, but then they will ask you to prove that you will reside outside Quebec, for example, lease agreement.
So, You should be very careful with your intention to live outside Quebec, if you plan to work in Quebec and apply with Quebec address, then the officer will ask you to provide strong evidence (lease agreement, driver's license, etc.) that you will reside outside Quebec. You will be more suspicious and it is a possibility that the officer will do more background checks that will cause delays. So to exclude all these suspicions, it is highly recommended to apply when you reside outside Quebec with a good LOE where you will convince the officer that you don't want to reside in Quebec and explain that this job in Quebec is temporary and you maintain your address in other province than QC.