Step 1: Convert the sink temperature.
The sink is at $27^\circ$C, which in kelvin is $T_2=27+273=300$ K.
Step 2: Recall the Carnot efficiency.
The efficiency is $\eta=1-\dfrac{T_2}{T_1}$, where $T_1$ is the source temperature.
Step 3: Find the original source temperature.
With $\eta=0.4$, $0.4=1-\dfrac{300}{T_1}$, so $\dfrac{300}{T_1}=0.6$ and $T_1=\dfrac{300}{0.6}=500$ K.
Step 4: Find the new source temperature.
For $\eta'=0.5$ with the same sink, $0.5=1-\dfrac{300}{T_1'}$, so $\dfrac{300}{T_1'}=0.5$ and $T_1'=\dfrac{300}{0.5}=600$ K.
Step 5: Find the increase.
\[ \Delta T=T_1'-T_1=600-500=100\ \text{K} \]
Step 6: Conclude.
The source temperature must be raised by $100$ K.
\[ \boxed{100\ \text{K}} \]