Since Perl was your first tag, I guess you'd want a Perl version of the solution.
If you have Perl installed on your Windows, the following works (whitespace added for readability):
C:\>perl -e "open(my $rf, '<', 'c:\output.txt')
|| die \"Can not open c:\output.txt: $!\";
my $replace = <$rf>;
chomp $replace;
close $rf;
local $^I='.bak'; # Replace inside the file, make backup
while (<>) {
s/great/$replace/g;
print;
}" c:\newfile.txt
C:\>type C:\newfile.txt
Stack overflow is abcd
To be a bit more Windows idiomatic, you can replace the start of the Perl code (reading of the contents of a file) with a "cmd"'s SET /P
command (see Ghostdog's asnwer), for a much shorter Perl code:
C:\> set /p r=<c:\output.txt
C:\> perl -pi.bak -e "s/great/%r%/g;" c:\newfile.txt
C:\> type C:\newfile.txt
Stack overflow is abcd